您好我想知道是否有任何的方式来做到这一点看在Android的原生: http://jquerymobile.com/demos/1.0/docs/buttons/buttons-grouped.html分组水平按钮组中的Android
特别是我在寻找外部按钮具有圆滑的边缘,而内部按钮是完美的矩形。
您好我想知道是否有任何的方式来做到这一点看在Android的原生: http://jquerymobile.com/demos/1.0/docs/buttons/buttons-grouped.html分组水平按钮组中的Android
特别是我在寻找外部按钮具有圆滑的边缘,而内部按钮是完美的矩形。
你可以为每个做Shape文件。只需为特定按钮定义角半径并使用它即可创建Shape文件。
例如顶部按钮1
设置按钮的背景像这样
<Button android:id="@+id/btn1" android:text="Click" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:background="@drawable/mycorner"/>
创建绘制文件夹不同形状不同的XML文件喜欢这里mycorner.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:bottomLeftRadius="8dip"
android:topRightRadius="8dip"
android:topLeftRadius="1dip"
android:bottomRightRadius="1dip"
/>
<padding android:left="5dp" android:right="5dp" android:top="5dp" android:bottom="5dp" />
<gradient android:startColor="#ffffff" android:endColor="#ffffff" />
</shape>
让三个按钮,将它们像这样:
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
这将均匀地空间的每个按钮。至于圆角,这里有很多例子,只是搜索。 https://stackoverflow.com/search?q=%5Bandroid%5D+round+button+corners
谢谢你,我会试试这个。 – blinduck 2012-01-04 13:19:45