SwitchButton
Android仿IOS的Segmented Control 选项卡
Install / Use
/learn @mvpleung/SwitchButtonREADME
SwitchButton
Android仿IOS的Segmented Control
如何使用:
<com.lzc.switchbutton.widget.SwitchButton
android:id="@+id/switchButton"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_margin="15dp"
android:textColor="@color/switch_textcolor_selector"
app:sw_checkedColor="@color/green"
app:sw_strokeColor="@color/green"
app:sw_switchCount="4"
app:sw_textArray="@array/test" />
注:layout_width 只能固定宽度或者使用 match_parent
属性说明:
<attr name="android:textColor" /> //文本颜色,可以是Selector
<attr name="android:textSize" /> //文本大小
<attr name="sw_textArray" format="string" /> //文本数组(array)
<attr name="sw_switchCount" format="integer" /> //Button数目
<attr name="sw_ThemeStyle" format="reference" /> //Button 样式
<attr name="sw_CornerRadius" format="dimension" /> //圆角弧度
<attr name="sw_checkedColor" format="color|reference" /> //选中的颜色
<attr name="sw_unCheckedColor" format="color|reference" /> //未选中的颜色
<attr name="sw_strokeColor" format="color|reference" /> //边框颜色
<attr name="sw_strokeWidth" format="dimension" /> //边框粗细

Related Skills
node-connect
354.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
