0

Like this

I want to set focusable and clickable mode for LinearLayout (like in above image). How to I make this?

4

2 回答 2

1

试试这个,它对我有用

<LinearLayout android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:clickable="true"
              android:focusable="true"
              android:background="?android:attr/selectableItemBackground">
</LinearLayout>
于 2017-09-22T12:06:29.287 回答
0

在您定义的 XML 文件中,您可以在元素中包含:

机器人:焦点=“真”

或者

安卓:可点击=“真”

于 2015-09-18T06:05:38.940 回答