Android 关于在TextView中使用省略号的问题
我正在文本视图中使用省略号。从这里开始,它说它应该被截断。 但我看不出它会变老。基本上,我希望两个文本字段彼此相邻。 txt1在右侧,txt2在左侧。我希望txt2太长时被截断。但我现在看到的是它与txt1的文本重叠Android 关于在TextView中使用省略号的问题,android,Android,我正在文本视图中使用省略号。从这里开始,它说它应该被截断。 但我看不出它会变老。基本上,我希望两个文本字段彼此相邻。 txt1在右侧,txt2在左侧。我希望txt2太长时被截断。但我现在看到的是它与txt1的文本重叠 我想你想在txt2中使用android:layout_toLeftOf=“@id/txt1”,意思是txt2在txt1的左边。看起来您正试图在视图的右侧进行布局,该视图当前与父视图的右侧对齐 <RelativeLayout andro
我想你想在txt2中使用android:layout_toLeftOf=“@id/txt1”,意思是txt2在txt1的左边。看起来您正试图在视图的右侧进行布局,该视图当前与父视图的右侧对齐
<RelativeLayout
android:id="@+id/one"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/txt1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:singleLine="true"
android:layout_centerVertical="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary"/>
<TextView
android:id="@+id/txt2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_toRightOf="@id/txt1"
android:ellipsize="end"
android:singleLine="true"
android:layout_weight="1"
android:layout_centerVertical="true"
/>
</RelativeLayout>