Android ListView ArrayAdapter-复选框/单选按钮排列 [英] Android ListView ArrayAdapter - checkbox/radio button arrangement

查看:154
本文介绍了Android ListView ArrayAdapter-复选框/单选按钮排列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以重新排列复选框,使其出现在文本之前?

Is there a way to rearrange the checkboxes so that it appears before the text?

我正在将ArrayAdapter与simple_list_item_multiple_choice一起使用,理想情况下,我希望看到开头的复选框,之后是文本.

I am using ArrayAdapter with simple_list_item_multiple_choice, ideally, I would like to see the checkboxes at the start, with the text following after.

还是应该制作一个自定义适配器来实现此目的?

Or should I make a custom adapter to achieve this?

谢谢.

推荐答案

我找到了一种解决对齐方式的方法.

I found a way to fix the alignment.

listView.setAdapter(arrayAdapter);

使用listView.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);

像魅力一样工作.

这篇关于Android ListView ArrayAdapter-复选框/单选按钮排列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆