scrollview子根布局添加代码:
android:focusable=”true”
android:focusableInTouchMode=”true”
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical">
</LinearLayout>
</ScrollView>
本文介绍如何在ScrollView中正确地设置焦点属性,确保触摸模式下能够正常获取焦点,通过示例代码展示了如何为ScrollView及其子布局LinearLayout配置焦点相关属性。
1932

被折叠的 条评论
为什么被折叠?



