我在使用textView之前沒有斷開ICS之前的線路。在ICS(我相信蜂窩工作,但我還沒有嘗試過壽)textView內的文本很好地打破,但在薑餅和文本下面只是繼續在一行。任何想法如何解決這一問題?TextView不會中斷文本
我正在使用viewpager,這是每個屏幕的佈局。我使用自定義textView只是爲了添加自定義字體,希望這不是問題。
pager_item.xml:`
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:padding="20dp" >
<com.ursus.absolution.startme.MyTextView
android:id="@+id/message_textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/quotes_background"
android:gravity="center"
android:textColor="#585858"
android:textSize="25dp" />
<com.ursus.absolution.startme.MyTextView
android:id="@+id/author_textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="#585858"
android:textSize="20dp" />
</LinearLayout>`
In ICS
_____________
| |
| |
| "This is |
| my cool |
| text" |
| |
|___________|
In gingerbread and below
_____________
| |
| |
| "This is my cool text"
| |
| |
| |
|___________|
對不起即時通訊新我不能張貼圖片。在此先感謝,希望你們得到它。
/////// UPDATE ///////////////
好球員,這很有趣。我嘗試了所有的建議,但是既沒有工作,所以我開始了一個新的空白項目,只是把一個textview與真正的長字符串佈局,它包裹得很好。
所以,我不知道這是怎麼可能的,但它的風格做這個操作欄的自定義主題,當我在清單中註釋它工作得很好,但是系統全息主題似乎這樣做
AndroidManifest.xml中
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ursus.absolution.startme"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<application
android:icon="@drawable/iconn"
android:label="@string/app_name"
android:theme="@style/Theme.myStyle" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
</activity>
<activity
android:name=".SplashScreenActivity"
android:label="@string/title_activity_main"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
styles.xml
<resources>
<style name="Theme.myStyle" parent="@android:style/Theme.Holo">
<item name="android:actionBarStyle">@style/mycoolstyle_transparent_ActionBar</item>
</style>
<style name="mycoolstyle_transparent_ActionBar" parent="@android:style/Widget.Holo.ActionBar">
<item name="android:background">@drawable/transparent_actionbar</item>
</style>
...所以當我添加機器人:在清單主題= 「@風格/ Theme.myStyle」 的textviews胡作非爲然而,當我添加機器人:主題=「@安卓風格/主題。全息「而不是,因爲我通常會強制全息主題,它missbehave以及
怪異。
可能重複(http://stackoverflow.com/questions/2197744/android-textview-text-not-getting-wrapped) – wsanville 2012-07-20 16:23:08
嘗試向你的TextView添加'android:singleLine =「false','false'應該是默認值但也許在你的應用中覆蓋它。 – Dalmas 2012-07-20 16:26:58
正常的TextView會自動換行,所以我認爲問題出在您的自定義TextView上。如果您只想更改字體,請使用'android:typeface =「」',如[在此討論](http://stackoverflow.com/q/2888508/1267661)。如果您仍然需要幫助,請發佈您的MyTextView類,以便我們看到發生了什麼。 – Sam 2012-07-20 16:27:54