我想要這種外觀。他們似乎不像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
它的一點點棘手,你可以使用角形圖像作爲按鈕的背景,並添加一個條件,如果選擇了一個按鈕更改其他按鈕背景爲正常。它會給人感覺像標籤。 –