2013-05-14 60 views
2

對不起我的英語TextView的填充點

我有一個RelativeLayout的和2個textviews像

<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

回答

0

沒有java代碼:

抽拉/ 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); 
+0

很好..感謝ü! – user1959076