TextView won't break text

后端 未结 2 976
别跟我提以往
别跟我提以往 2021-01-07 05:52

I am having trouble with textView not breaking line before ICS. In ICS (i belive honeycomb works as well but i havent tried it tho) the text inside textView breaks nicely bu

2条回答
  •  隐瞒了意图╮
    2021-01-07 06:17

    This issue is reported in various forms, here and here for example. Many of the issues reports a previous working layout that gets broken when updating to ICS/holo theme.

    I was able to reproduce it easily, it's a matter of a line of xml: @android:style/Theme.Holo

    The easiest way to go around it is to introduce a versioned values folder, to let Android pick the right one. In other words You'll have 2 styles.xml:

    • inside values-v11 folder you should put the one you specified (with parent="@android:style/Theme.Holo")
    • inside old values folder you'll put the 'plain' one, with parent="android:Theme.Black.NoTitleBar".

    Your manifest should remain unchanged, and Android will pick the right xml based on its version. The solution may not be the most elegant, but at least you won't mess with android:maxlines, android:width and so on

提交回复
热议问题