带有android的TextView:textIsSelectable =“true”在listview中不起作用

时间:2015-08-17 11:14:54

标签: android textview selection

我知道它与textview textIsSelectable="true" not working in Listview类似。

TextView出现,复制,解析时,一切都很好。但是当它在列表的项目中时。我长按Textview,复制和解析菜单似乎在顶部(ActionBar)有吸引力,但它在半秒内消失。

我想,ListView被推下来,所以它回忆起getView()。好的,这是我的猜测。

任何人都可以帮助我。

我的英语很差。如果不清楚,请原谅我......

由于

我的getView:

            if (convertView == null) {
                convertView = getLayoutInflater().inflate(R.layout.item_list, parent, false);
            }
            TextView textView = (TextView) convertView;
            textView.setFocusable(true);
            textView.setFocusableInTouchMode(true);
            if (TextUtils.isEmpty(textView.getText())) {
                textView.setText("fdafdafdafkdsfjkldsfjioewjfiodsajlf" + position);
            }
            return convertView;

我的item_list.xml:

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
          android:padding="20dp"
          android:textIsSelectable="true"
          android:id="@+id/textView"
          android:layout_width="match_parent"
          android:layout_height="match_parent">

</TextView>

如果正常,则复制和解析菜单出现:

enter image description here

但是在ListView中,操作栏菜单向下推了ListView所以ListView让这个菜单消失了吗?

0 个答案:

没有答案