2012-04-13 2 views
0

에 텍스트 뷰에서 제대로 작동하지 :Ellipsize 내가이 유사 여러 행이있는 테이블 가지고 TableLayout을

<TableRow 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="text" 
     android:textAppearance="?android:attr/textAppearanceSmall" 
     android:textSize="12sp" 
     android:layout_gravity="right|center_vertical" 
     android:layout_margin="4dip" /> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="some text" 
     android:textAppearance="?android:attr/textAppearanceMedium" 
     android:textSize="13sp" 
     android:textStyle="bold" 
     android:layout_gravity="left|center_vertical" 
     android:layout_margin="4dip" 
     android:ellipsize="end" 
     android:lines="1" 
     android:scrollHorizontally="true" 
     android:layout_weight="1" /> 

    <ImageView 
     android:src="@drawable/disclosure_indicator" 
     android:contentDescription="@string/emptyString" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:scaleType="fitXY" /> 

</TableRow> 

을하지만,을 제 2 텍스트 뷰는 대체 마지막으로 '단어'의 '...'있는 경우가 텍스트보기의 행이 나머지 공간보다 넓습니다.

그래서 같은 것을 사용 :

"Some sort string" 
"Some string that is a little bit longer" 
"Singleword" 

표는과 같이 렌더링 : 분명히 첫 번째 행의 전체 문자열을 표시하기에 충분한 공간이

text | Some short...      | > 
text | Some string that is a little bit... | > 
text |          | > 

있다. 줄/잘라 내기가 각 행에 올바르게 작동하도록하려면 어떻게해야합니까?

+0

http://stackoverflow.com/questions/3332924/textview-marquee-not-working – yokees

답변

-1

@ MarSara9 두 번째 텍스트보기의 레이아웃 중력을 변경하십시오.

안드로이드 :이 솔루션은 샘플 코드와 함께 일 layout_gravity = "center_vertical"

관련 문제