Android布局为,Fragment,ScrollView,Viewpager切换焦点问题
来源:互联网 发布:js文件中加spring标签 编辑:程序博客网 时间:2024/06/10 22:51
当页面应用Fragment来实现TabHost功能效果时,Fragment中添加Fragment类A,B,C。
类A中的布局为Viewpager( add Fragment类),加入的Fragment类中应用ScrollView,此时,在切换 A , B , C页面时,
A页面中的ScrollView焦点会发生上移现象。
可以在最早的Fragment中添加
android:focusableInTouchMode="true"
android:focusable="true"
android:descendantFocusability="beforeDescendants"
这样就能解决此问题。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="match_parent"
android:layout_width="match_parent">
<FrameLayout
android:focusableInTouchMode="true"
android:focusable="true"
android:descendantFocusability="beforeDescendants"
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="@+id/main_tab_top_line"
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/act_line" />
<include layout="@layout/layout_main_tabs"/>
</LinearLayout>
- Android布局为,Fragment,ScrollView,Viewpager切换焦点问题
- Android布局为,Fragment,ScrollView,Viewpager切换焦点问题
- Android Viewpager切换焦点问题,ScrollView,ListView发生位移
- 解决android FragmentTabHost + viewpager + fragment 嵌套布局切换出现白屏什么都没有问题
- 解决常见布局Viewpager+Fragment多页面切换销毁问题
- android scrollview fragment viewpager 切换 状态 变化 scrollview 滚动到最上方
- viewpager+fragment+viewpager+scrollview滑动冲突问题
- Android fragment+viewpager 切换Tab
- android fragment+ FragmentTabHost+viewpager 切换状态不保存的问题
- Android ViewPager+Fragment切换显示不出的问题
- Android ViewPager+Fragment切换显示不出的问题
- 处理ScrollView占据布局的焦点问题
- android(9) ListView + ScrollView + ViewPager布局
- Android横竖屏切换后,重新设置activity布局,ViewPager上无法正确显示Fragment
- Android Fragment中使用ViewPager+Fragment切换显示不出的问题
- viewpager、fragment滑动切换卡顿问题
- viewpager + fragmentpageradapter 切换fragment产生的问题
- viewpager切换fragment时崩溃问题
- java中数组与List相互转换的方法和遇到的问题
- 哈希表算法实现
- MFC调用HALCON实现相机采图和图像显示
- 数据仓库的模型设计 A. 数据建模方法论 数据仓库模型设计遵循“自顶向下、逐步求精”的设计原则。 模型设计分为三个阶段: 1,概念模型 对业务的范围和使用,从高度上进行抽象概括,也就是划分主题域。 一
- hashCode与equals的区别与联系
- Android布局为,Fragment,ScrollView,Viewpager切换焦点问题
- Android中Framework层条件变量(condition)的使用方法
- 关于自定义AlertDialog,设置不能充满全屏的解决方法
- Insertion Sort List--LeetCode
- WebView
- kernel panic not syncing : attempted to kill the idle task.
- modbus功能码简述
- 用c实现HASH表创建、插入、查找、删除、打印
- nyoj 545 Metric