如何为 MESSENGER\ACTIVE 片段创建类似于按钮的 Facebook Messenger,以及如何使用它们交换片段?
How to create Facebook Messenger like buttons for MESSENGER\ACTIVE Fragment, and how to swap fragments using them?
我想知道MESSENGER\ACTIVE按钮配置是如何实现的...
如果点击按钮切换片段将适用于此配置..?
您可以通过自定义一个 RadioGroup
和两个 RadioButton
作为 child 来实现。
这里有一些提示-
步骤可以这样
- 在
xml
中创建一个 drawable
shape
类型的矩形,带有角和描边。将其用于 RadioGroup
背景。
- 为两个
RadioButon
使用相似的形状(根据所选颜色和 un-selected 一个)创建 selector
,并将它们设置为单独的背景。
- 在 xml 中为选定和 un-selected 状态创建一个
color
drawable
,并将其作为 textColor 设置为 RadioButton
- 将
RadioButton
的 android:button
属性设置为空。
这是我作为 SO 问题的答案发布的示例 - How to custom switch button?
我想知道MESSENGER\ACTIVE按钮配置是如何实现的...
如果点击按钮切换片段将适用于此配置..?
您可以通过自定义一个 RadioGroup
和两个 RadioButton
作为 child 来实现。
这里有一些提示-
步骤可以这样
- 在
xml
中创建一个drawable
shape
类型的矩形,带有角和描边。将其用于RadioGroup
背景。 - 为两个
RadioButon
使用相似的形状(根据所选颜色和 un-selected 一个)创建selector
,并将它们设置为单独的背景。 - 在 xml 中为选定和 un-selected 状态创建一个
color
drawable
,并将其作为 textColor 设置为RadioButton
- 将
RadioButton
的android:button
属性设置为空。 这是我作为 SO 问题的答案发布的示例 - How to custom switch button?