对不起我的英语
我有一个 RelativeLayout 和 2 个类似的 TextView
<RelativeLayout
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView9"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
我想用点来分隔这两个元素。像那样:
TextView9 ..................................... TextView10
其他文本更长...................................... 69
最佳答案
没有java代码:
drawable/dotted.xml:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke
android:color="#C7B299"
android:dashWidth="10px"
android:dashGap="10px" />
</shape>
View .xml:
<View
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/dotted" />
同时设置:
view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
关于android - TextView 填充点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16551085/