android - TwoLineListItem text alignment

元气小坏坏 提交于 2019-12-24 00:56:01

问题


I am using a twolinelistitem for displaying two lines in each list item - Name and Summary. The Summary is a little big to fit in one line, thus when i display on screen, the summary gets cut and doesnt look good. What is the way to make sure the that the whole summary is visible in the list item?

here's the code -

<TwoLineListItem android:paddingTop="2dip" 
android:paddingBottom="2dip" 
android:layout_width="fill_parent" 
android:layout_height="?android:attr/listPreferredItemHeight" 
android:mode="twoLine">

<TextView android:textAppearance="?android:attr/textAppearanceLarge" 
    android:id="@android:id/text1"  
       android:layout_width="fill_parent"    
        android:layout_height="wrap_content"  
           android:layout_marginLeft="27dip"   
             android:layout_marginTop="6dip"
             android:textColor="#474747"
             />
<TextView android:textAppearance="?android:attr/textAppearanceSmall"  
   android:id="@android:id/text2"  
      android:layout_width="fill_parent" 
      android:textColor="#00CDCD"
          android:layout_height="wrap_content"  
             android:layout_below="@android:id/text1"  
                android:layout_alignLeft="@android:id/text1">
</TextView>
</TwoLineListItem>

来源:https://stackoverflow.com/questions/7426498/android-twolinelistitem-text-alignment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!