0

カスタム トーストを使用していますが、フィールドが長すぎるとテキスト ビューが切り取られることがあります。

XML:

 <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/toast" >

   <TextView
                android:id="@+id/textView"
                android:layout_width="wrap_content"
                android:layout_gravity="fill_horizontal"
                android:layout_height="wrap_content"
                android:layout_alignBaseline="@+id/someotherview"
                android:layout_alignBottom="@+id/someotherview"
                android:layout_alignLeft="@+id/someotherview"
                android:text=""
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textStyle="bold" />

        </RelativeLayout>

Android:gravity="fill" から android:ellipsize="marquee" まで、事実上すべてを試しました。何も機能していないようです。誰かが理由を知っていますか?

4

1 に答える 1

0

おそらく、次のようなものが役立ちます: http://www.androidviews.net/2012/12/autoscale-textview/

他のビューに収まるようにテキストビュー (およびテキスト) のサイズを変更します。

于 2012-12-16T11:20:49.233 に答える