在列表项的布局一个TextView使用inputType下 [英] Using inputType on a TextView in a list item layout

查看:323
本文介绍了在列表项的布局一个TextView使用inputType下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个ListActivity。我有定义了布局此活动的XML文件。我还具有定义的布局在该列表中的项目的XML文件。此产品布局有它内部的3 TextViews。如果我添加的inputType =Text属性这些TextViews之一,onListItemClick处理程序不再运行我在模拟器应用程序执行。

I've made a ListActivity. I have an xml file that defines the layout for this Activity. I also have an xml file that defines the layout for an item in that list. This item layout has 3 TextViews inside of it. If I add the inputType="text" property to one of these TextViews, the onListItemClick handler no longer executes when I run my application in the emulator.

我注意到,单线=真是pcated德$ P $,这就是为什么我打开它出去的inputType =文本。有谁知道为什么发生这种情况?

I noticed that singleLine="true" was deprecated, which is why I switched it out for inputType="text". Does anyone know why this is happening?

请注意:我正在开发针对2.1

Note: I'm developing against 2.1

感谢您的帮助。

推荐答案

设置一个inputType下可能导致的TextView要成为焦点,当你有一个ListView排聚焦元素,该行已不再是可以点击的。

Setting an inputType probably causes the TextView to be focusable , and when you have a focusable element in a ListView row, the row is no longer clickable.

inputType下与用户输入文本做。相当于SINGLELINE =真。将线=1,不inputType下=文字

InputType has to do with users entering text. The equivalent to singleLine="true" would be lines="1", not inputType="text"

这篇关于在列表项的布局一个TextView使用inputType下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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