在列表视图中选中复选框时,按钮中的文本从中心向左移动
我创建了一个屏幕,其中包含表格布局中的三个水平按钮和列表视图。 每当我单击列表视图中的复选框时,按钮中的文本就会向左移动。 请解决问题。 请参阅屏幕布局代码和屏幕截图。
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TableLayout android:id="@+id/TableLayout01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<TableRow android:id="@+id/TableRow01"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="@color/list_select" android:weightSum="3">
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/set"
android:text="@string/button_settings_done"
android:layout_marginTop="@dimen/button_settings_margin_top"
android:textColor="@color/buttonColor"
android:textStyle="bold"
android:typeface="serif" android:layout_weight="1">
</Button>
<Button android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="@string/button_settings_cancel"
android:id="@+id/cancel"
android:layout_marginTop="@dimen/button_settings_margin_top"
android:textColor="@color/buttonColor"
android:textStyle="bold"
android:typeface="serif" android:layout_weight="1"></Button>
<Button
android:id="@+id/delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/button_settings_margin_top"
android:text="@string/button_settings_delete"
android:textColor="@color/buttonColor"
android:textStyle="bold"
android:typeface="serif" android:layout_weight="1"/>
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/TableLayout01"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" android:cacheColorHint="@color/transparent" android:divider="@color/list_select" android:dividerHeight="@dimen/list_settings_divider_height">
</ListView>
屏幕截图
I have created a screen which consist of three horizontal button in a table layout and a list view.
Whenever i click on a check box present in the list view the text present in the button shifts to the left.
Kindly resolve the issue.
Please refer the screen layout code and the screen shots for same.
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TableLayout android:id="@+id/TableLayout01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<TableRow android:id="@+id/TableRow01"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="@color/list_select" android:weightSum="3">
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/set"
android:text="@string/button_settings_done"
android:layout_marginTop="@dimen/button_settings_margin_top"
android:textColor="@color/buttonColor"
android:textStyle="bold"
android:typeface="serif" android:layout_weight="1">
</Button>
<Button android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="@string/button_settings_cancel"
android:id="@+id/cancel"
android:layout_marginTop="@dimen/button_settings_margin_top"
android:textColor="@color/buttonColor"
android:textStyle="bold"
android:typeface="serif" android:layout_weight="1"></Button>
<Button
android:id="@+id/delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/button_settings_margin_top"
android:text="@string/button_settings_delete"
android:textColor="@color/buttonColor"
android:textStyle="bold"
android:typeface="serif" android:layout_weight="1"/>
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/TableLayout01"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" android:cacheColorHint="@color/transparent" android:divider="@color/list_select" android:dividerHeight="@dimen/list_settings_divider_height">
</ListView>
Screen shots
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这很奇怪,但试试这个......
当您单击列表视图中存在的复选框时..在 OnClick 方法上..再次设置这些按钮的文本..就像
在我的情况下效果很好..我遇到了同样的问题。
希望这对你有帮助
its weird but try this...
when you are clicking on a check box present in the list view..there on OnClick method..set the text of these button again..like
It worked very well in my case..I had the same problem.
hope this helps you