2017-11-27 17 views
0

I項目は背景破線が、結果を設定してみてください - アンダー

<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="line"> 

    <stroke 
     android:color="#100901" 
     android:dashWidth="10px" 
     android:dashGap="10px" 
     android:width="1dp"/> 
</shape> 

に設定破線を試してみて、androidstudioに、私はすべての正しいを参照してください。しかし、実際のアプリで私は破線とアンダースコアを参照してください。代わりに、レイヤリストの描画可能に使用し

enter image description here

答えて

2

<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> 
<item 
    android:bottom="2dp" 
    android:left="-2dp" 
    android:right="-2dp" 
    android:top="-2dp"> 
    <shape> 
     <solid android:color="@android:color/transparent" /> 
     <stroke 
      android:width="1dp" 
      android:color="#100901" 
      android:dashGap="10px" 
      android:dashWidth="10px" /> 
    </shape> 
</item> 
</layer-list> 
0

これで実現できます。

<?xml version="1.0" encoding="utf-8"?> 
    <bitmap xmlns:android="http://schemas.android.com/apk/res/android" 
    android:src="@drawable/triangleup" 
    android:tileMode="repeat" 
    android:tint="@color/lightAccent"/> 

ここで、triangleupはダッシュラインの画像です。

ハッピーコーディング!