嗨我正在寻找一个在Android的用户界面,在那里我想把四个圆形按钮放在彼此靠近的钻石形成。所以我不能让它们包含在一个正方形网格中,或者它们会重叠在一起。Android中不规则形状按钮布局的任何示例?
任何人都可以指向一个具有不规则形状(非方形)按钮的教程或示例代码吗?
嗨我正在寻找一个在Android的用户界面,在那里我想把四个圆形按钮放在彼此靠近的钻石形成。所以我不能让它们包含在一个正方形网格中,或者它们会重叠在一起。Android中不规则形状按钮布局的任何示例?
任何人都可以指向一个具有不规则形状(非方形)按钮的教程或示例代码吗?
怎么样一个TableLayout只是按住按钮。使用TableLayout作为容器来包装您的按钮。然后将TableLayout锚定到您想要按钮组的位置。
PSUEDOCODE
<TableLayout
android:id="@+id/ButtonContainer"
android:layout_width="3XButtonWidth"
android:layout_height="3XButtonHeight"
android:layout_alignParentBottom="OrWhereYouNeedIt"
android:layout_alignParentRight="OrWhereYouNeedIt"
>
<TableRow
android:id="@+id/FirstRow">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageButton
android:id="@+/TopButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:AnyOtherParams="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</TableRow>
<TableRow
android:id="@+id/MiddleRow">
<ImageButton
android:id="@+/LeftButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:AnyOtherParams="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageButton
android:id="@+/RightButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:AnyOtherParams="true"/>
</TableRow>
<TableRow
android:id="@+id/LastRow">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageButton
android:id="@+/BottomButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:AnyOtherParams="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</TableRow>
</TableLayout>
我知道这是旧的,但找到了解决方案吗?我有一个类似的问题: http://stackoverflow.com/questions/27367068/overlapping-buttons-with-custom-shape – Phil3992 2014-12-09 21:39:48