我想要这种外观。他们似乎不像tabs
,所以我相信他们是按钮。使按钮看起来像在Android中的标签
我能够在绘制保持与选择到toggle button
的acheive相似类型。
<ToggleButton
android:id="@+id/toggleButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/custom_selector"
android:textOn=" Button1 Button2"
android:textOff=" Button1 Button2" />
但他们只有两个值,并通过单击选定的选项卡上获取其他选择本一条未选。但我想要完全像标签。那么有人可以帮我实现它吗?提前致谢。
不要切换按钮使用,采取四个按钮和使用选择的绘制。 –
@ManojPal谢谢,但那些看起来不像上面的角落形状和所有。这也通过选择一个按钮之前选择的按钮应再次获得正常的颜色。 – rick
它的一点点棘手,你可以使用角形图像作为按钮的背景,并添加一个条件,如果选择了一个按钮更改其他按钮背景为正常。它会给人感觉像标签。 –