在 style 文件中通过 icon_at 属性设置图标位置。
<style name="right_bottom" icon_at="right_bottom">
<normal icon="unchecked_right_bottom" />
<pressed icon="unchecked_right_bottom" />
<over icon="unchecked_right_bottom" text_color="green"/>
<focused icon="unchecked_right_bottom" text_color="green"/>
<normal_of_checked icon="checked_right_bottom" text_color="blue"/>
<pressed_of_checked icon="checked_right_bottom" text_color="blue"/>
<over_of_checked icon="checked_right_bottom" text_color="green"/>
<focused_of_checked icon="checked_right_bottom" text_color="green"/>
<normal_of_indeterminate icon="indeterminate" text_color="blue"/>
<pressed_of_indeterminate icon="indeterminate" text_color="blue"/>
<over_of_indeterminate icon="indeterminate" text_color="green"/>
<focused_of_indeterminate icon="indeterminate" text_color="green"/>
</style>
- 代码
<check_button text="icon at left1" focusable="true" style="left"/>
- 效果
- 代码
<check_button text="icon at right1" focusable="true" style="right" />
- 效果
- 代码
<check_button text="icon at top" focusable="true" style="top" />
- 效果
- 代码
<check_button text="icon at bottom" focusable="true" style="bottom" />
- 效果
- 代码
<check_button text="icon at left_top" focusable="true" style="left_top" />
- 效果
- 代码
<check_button text="icon at right_top" focusable="true" style="right_top" />
- 效果
- 代码
<check_button text="icon at left_bottom" focusable="true" style="left_bottom" />
- 效果
- 代码
<check_button text="icon at right_bottom"
focusable="true" style="right_bottom" />
- 效果
注意:center 属性不要 text 属性,否则退化为 left 属性。
- 代码
<check_button focusable="true" style="center" />
- 效果