---
title: "关于ListView中假如Button，EditText无法响应问题"
author: "四眼蛤蟆"
date: "2011-03-03T20:05:43Z"
tags: ["Android"]
categories: ["编程语言"]
slug: "listview-button-edittext"
draft: false
lastmod: "2011-03-03T20:05:43Z"
id: 939988
url: "https://jeff-pluto-1874.iteye.com/blog/939988"
---

个人成功试验结果：

为Button或者EditText加上一个布局；

 

```
<RelativeLayout
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:descendantFocusability="blocksDescendants">
		<Button
			android:id="@+id/attention_btn"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:background="@drawable/btn_attention_normal"
			android:layout_alignParentRight="true"
			android:focusable="false"/>
</RelativeLayout>
```

 

其中两个重要的属性：

RelativeLayout：android:descendantFocusability="blocksDescendants"

Button：android:focusable="false"