【问题标题】:Android - Spinner: text in several linesAndroid - Spinner:多行文本
【发布时间】:2012-05-16 10:03:00
【问题描述】:

我已经完成了关于 Spinner 的教程([http://developer.android.com/resources/tutorials/views/hello-spinner.html]). 但是,如果文本比行星的名称长得多,点击 spinner 后显示的文本会被截断,它不会完整显示。

有谁知道如何让较长的文本分几行显示?

单击微调器后,文本将显示在名为 CheckedTextViews 的对象表中。也许应该修改其中的一些偏好 - 这只是一个快速的想法。

很高兴得到任何支持。

【问题讨论】:

    标签: android text spinner checkedtextview truncated


    【解决方案1】:

    这也很好用。

    <LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="350dp"
     android:layout_height="wrap_content">
    
    <TextView 
     android:id="@android:id/text1"
     style="?android:attr/spinnerDropDownItemStyle"
     android:layout_width="match_parent"
     android:layout_height="50dp"
     android:ellipsize="marquee"
     android:gravity="center_vertical"
     android:singleLine="false" />
    </LinearLayout>
    

    【讨论】:

      猜你喜欢
      • 2012-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-07
      相关资源
      最近更新 更多