GridView和Gallery嵌套在FrameLayout,GridView的getView()里面的position一直为0
来源:互联网 发布:下载我的淘宝网 编辑:程序博客网 时间:2024/05/01 11:20
直接上代码:
这是我的activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/main_head_title"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center"
android:text="我擦"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/main_head_title"
>
<FrameLayout
android:id="@+id/fragment_ss"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</RelativeLayout>
Fragment里面的xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/darkgrey"
android:orientation="vertical">
<com.example.dell.gridviewtest.CustomGallery
android:id="@+id/id_gallery"
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_gravity="center_vertical"
android:orientation="horizontal"
android:spacing="30dp"/>
<GridView
android:id="@+id/gridView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:cacheColorHint="#0000"
android:horizontalSpacing="1px"
android:listSelector="#0000"
android:numColumns="3"
android:scrollbars="none"
android:verticalSpacing="1px"/>
</LinearLayout>
这是我的activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/main_head_title"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center"
android:text="我擦"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/main_head_title"
>
<FrameLayout
android:id="@+id/fragment_ss"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</RelativeLayout>
Fragment里面的xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/darkgrey"
android:orientation="vertical">
<com.example.dell.gridviewtest.CustomGallery
android:id="@+id/id_gallery"
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_gravity="center_vertical"
android:orientation="horizontal"
android:spacing="30dp"/>
<GridView
android:id="@+id/gridView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:cacheColorHint="#0000"
android:horizontalSpacing="1px"
android:listSelector="#0000"
android:numColumns="3"
android:scrollbars="none"
android:verticalSpacing="1px"/>
</LinearLayout>
0 0
- GridView和Gallery嵌套在FrameLayout,GridView的getView()里面的position一直为0
- android中ListView或GridView出现在adapter中的getView出现多次position为0的情况
- GridView Adapter里的getView多次调用position 0 解决方案
- Android中的GridView反复调用getView和getCount,并且getView中的position的值几乎都是0
- Android中的GridView反复调用getView和getCount,并且getView中的position的值几乎都是0
- ListView,GridView,Gallery的Adapter中的getView多次调
- 关于gallery使用中position为0时两次调用getView的解决
- listview中嵌套gridview时候,getview多次调用的bug
- 解决gridview的Adapter中getview方法,当position==0的时候加载两次
- ExpandableListView里面嵌套GridView的问题
- GridView Adapter里的getView为啥会多次调用position 0
- 如何解决listview/gridview的position=0时,getview被多次调用
- listview嵌套gridview 条目里面gridview显示不全的问题
- Android的GridView和Gallery结合Demo
- Android的GridView和Gallery结合Demo
- Android中关于GrideView,ListView的getView中position=0,错乱的问题。(在GridView的最后面添加两个固定item)
- gridview嵌套gridview的方法
- gridView中嵌套gridview 如何获得里面gridview的点击事件
- ASP.NET线程中更新UI控件
- ant 打包android工程 的问题
- tableview自动移动了
- ASP 正则问题
- 实体搜索
- GridView和Gallery嵌套在FrameLayout,GridView的getView()里面的position一直为0
- nsxmlparser解析xml出错
- 关于Gson解析Json的问题
- android 桌面悬浮窗口
- Objective-C编写高质量代码 字面量语法
- android sqlite创建数据库
- 安卓简单app开发实践,代码完成后没报错,但功能就是无法使用,学生菜鸟,求指导
- 【Handler问题求指导】使用Handler遇到了问题
- UIImageView 支持gif格式的动态图片吗?怎么用