android-ui - 使用 Android shape标签中的line能不能指定画出的线的起始点和结束点
怪我咯
怪我咯 2017-04-17 16:23:22
0
2
596

我现在想用shape标签画一个叉号,但是指定android:shape="line"之后没有发现那个属性是指定画的线的起始和结束位置的。
我用下面的代码画出来的线只能是水平的:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="line">
    <stroke android:color="@android:color/holo_blue_light"
        android:width="3dip" />
</shape>

这个问题怎么整啊?还是shape无法指定这种效果的?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(2)
黄舟

Shape cannot specify position attributes. Width, height, length, coordinates, etc. belong to the properties of the View control. Shape depends on the existence of the View control and cannot exist and be displayed independently

阿神
 <rotate
            android:fromDegrees="45"
            android:toDegrees="135"
            >
            <shape android:shape="rectangle">
                <size
                    android:width="200dp"
                    android:height="1dp"
                    />

                <solid android:color="@color/black"/>
            </shape>
        </rotate>

I don’t know what is the length and starting position of the line, but the angle is still ok

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!