【发布时间】:2014-12-10 10:19:28
【问题描述】:
<TextView
android:id="@+id/txtSender"
style="@android:style/TextAppearance.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginTop="10dp"
android:background="@drawable/sender_bubble"
android:gravity="center_vertical"
android:maxEms="11"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingRight="15dp"
android:paddingTop="5dp"
android:text="1234567"
android:autoLink="all"
android:textColor="@color/color_black"
android:textIsSelectable="true"
android:visibility="visible" />
这是我在 customcell 中的文本视图。当我单击 textview 时,它不允许我在 textview 中选择文本。它在我的 xperia 4.2.2 中运行完美,但是当我在 4.4.4 版本的设备中运行相同的代码时,它无法运行。
注意:当我将相同的 android:textIsSelectable="true" 属性设置为不在 Listview 中的 Textview 时,它在 4.4.4 中可以正常工作。 Listview 只需移动到底部并在半秒内重置到其原始位置。
【问题讨论】:
-
尝试将此属性 android:focusable="false" android:focusableInTouchMode="false" 添加到您的文本视图中。
-
android:descendantFocusability="beforeDescendants" 在您的列表项 xml 中
-
@HareshChhelana :我已经尝试添加这两个属性,但它似乎不起作用
-
@MeenalSharma : android:descendantFocusability="beforeDescendants" 也不起作用
-
参考以下链接,希望对您有所帮助。 stackoverflow.com/questions/15857755/…