2016-04-26 20 views
1

的代码是:不能改变形状绘制的高度

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="line"> 
<stroke android:color="#00000000"/> 
<size android:height="10dp"/> 
</shape> 

但不管如何我设置屁股高度我所得到的总是1DP

回答

1

试试这个:

<stroke 
    android:width="10dp" 
    android:color="#000000" /> 
+0

叶氏这一个工程!虽然我不明白我的错误是什么。非常感谢你! – Mes

0

你必须提及尺寸标签的高度和宽度两个参数。 试试下面的代码:

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="line"> 
<stroke android:color="#00000000"/> 
<size android:height="10dp" android:width="0dp"/> 
</shape> 
0

试试这个代码

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="line" 

    android:layout_height="100dp" 
    android:layout_width="100dp"> 

    <stroke 
     android:width="10dp" 
     android:color="#000000" /> 
</shape>