【发布时间】:2013-04-08 22:45:40
【问题描述】:
我想为标签等浏览器创建自定义标签主机。我对如何将其应用于图像中的 chrome 浏览器选项卡中的布局感到困惑。
这是我尝试过的。我想知道如何用图像中的斜率创建边缘。
tab_selected.xml
<item>
<shape android:shape="rectangle" >
<solid android:color="#DCDCDC" />
<corners
android:topLeftRadius="5dp"
android:topRightRadius="5dp" />
</shape>
</item>
<item
android:bottom="2dp"
android:left="1dp"
android:right="1dp"
android:top="1dp">
<shape android:shape="rectangle" >
<solid android:color="#DCDCDC" />
<corners
android:topLeftRadius="10dp"
android:topRightRadius="10dp" />
</shape>
</item>
tab_unselected.xml
<item android:top="10dp">
<shape android:shape="rectangle" >
<solid android:color="#AAAAAA" />
</shape>
</item>
<item android:bottom="2dp">
<shape android:shape="rectangle" >
<solid android:color="#AAAAAA" />
<corners
android:topLeftRadius="10dp"
android:topRightRadius="10dp" />
</shape>
</item>
我希望可以使用 XML 中的 Pathshape 来完成。谁能指出我的参考?在 PathShape 上找不到参考
【问题讨论】:
-
您不能将它们创建为 xml drawable,九个补丁更合适。
-
@Luksprog 我希望通过 PathShape 以编程方式完成它。有可能通过吗?
-
@intrepidkarthi 你找到解决办法了吗
-
如果你使用你不能显示超过 5 个标签 .. 你可以吗?
-
使用九个补丁图像工作正常。
标签: android android-tabhost android-tabs android-browser