android 不可点击通知,android – inputType使项目不可点击

我有一个ListView,其中每个项目都有一个复杂的布局,在某些时候,包含一个带有android的TextView:inputType =“text”和android:ellipsize =“marquee”.我的问题是inputType =“text”做了一些使整个listview项无法点击的东西.我试过了:

> android:descendantFocusability =“blocksDescendants”在项目的最顶层布局上,

TextView本身> android:focusable =“false”,

在TextView本身上安装android:focusableInTouchMode =“false”,

TextView本身> android:clickable =“false”,

TextView本身> android:editable =“false”.

没有任何效果.

我在TextView上使用android:inputType =“text”的原因是它变成单行并且android:ellipsize =“marquee”实际上有效.我做完了我的作业:

> android:singleLine已被弃用*

> android:lines =“1”,如建议here,不起作用,文本仍然包装,你只是没有看到第二行,所以没有出现选框效果.

*或者是吗?我在Eclipse中的Ctrl空间说这个关于android:singleLine(强调我的):

Constrains the text to a single horizontally scrolling line instead of

letting it wrap onto multiple lines, and advances focus instead of

inserting a newline when you press the enter key. * Deprecated:

This attribute is deprecated and is replaced by the textMultiLine

flag in the inputType attribute. Use caution when altering

existing layouts, as the default value of singeLine is false (multi-

line mode), but if you specify any value for inputType, the default

is single-line mode. (If both singleLine and inputType attributes

are found, the inputType flags will override the value of

singleLine.). [boolean]

但是,the docs对任何弃用都没有任何说明.

这里发生了什么?

解决方法:

但是(如上所述)这与the TextView documentation page相矛盾.在查看相关方法时,设置singleLine属性相当于:

myTextView.setTransformationMethod(new SingleLineTransformationMethod());

这也没有被弃用.这就是我如何围绕这种贬值跳舞的方式.

标签:android,android-layout

来源: https://codeday.me/bug/20190705/1382980.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值