我想实现我在应用程序中构建的选项卡的圆角。到目前为止,我能够拿出这个Android中的TABS圆角
我想我的圆角看起来如此。 (我编写它只有左,右角落出现这样一种方式,但是当状态改变时它看起来像上面的图片)
下面是我到目前为止已经编写的代码。我如何通过代码实现适当的圆角?
SELECTED TAB.XML
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<corners
android:topRightRadius="10dp"
android:bottomLeftRadius="10dp"/>
<gradient
android:startColor="#000"
android:endColor="#000"
android:gradientRadius="400"
android:angle="-270"/>
</shape>
未选择TAB.XML
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<gradient
android:angle="90"
android:startColor="#880f0f10"
android:centerColor="#8858585a"
android:endColor="#88a9a9a9"/>
<corners
android:topLeftRadius="10dp"
android:bottomRightRadius="10dp"/>
</shape>
感谢您的答复! :)
五月这篇文章对您有所帮助几分:http://joshclemm.com/blog /?p = 136 – 2011-12-22 05:31:11
@Vinoth你有没有得到解决方案? – ShutterSoul 2016-02-11 10:25:51
@Vinoth你能为这个问题找到一个真正的解决方案吗? – moxi 2017-12-07 05:37:29