- 浏览: 437981 次
- 性别:
- 来自: 成都
文章分类
- 全部博客 (133)
- 内容 (5)
- H2数据库 Server服务器 (0)
- H2数据库 Server服务器 H2+JPA (2)
- JSF (10)
- TA测试 (1)
- Error Solution (1)
- WEB端测试 (2)
- JAVA API (0)
- WEB端自动化测试 (14)
- BAT文件 (1)
- javascript (0)
- Jenkins (5)
- Nexus (1)
- 操作系统 (3)
- OFBIZ (2)
- spingmvc (1)
- Hibernate3 (4)
- ubuntu (1)
- apache (2)
- Cisco (0)
- JBoss (2)
- SecureCRT (1)
- mysql (0)
- android (45)
- PHP (4)
- android studio (4)
- nodejs (1)
- iOS (0)
- JPA (1)
- gradle (0)
- Android端自动化测试 (2)
- okhttp3 (1)
- Java (2)
- mybatis (1)
- kettle (0)
最新评论
-
紫瑶诗书:
Android自动化测试实战(Java篇+主流工具+框架+脚本 ...
使用Robotium进行android自动化测试 -
wxynxyo:
上善若水_Happy 写道你好,想请教下icon的css是怎么 ...
Primefaces3之p:tree -
上善若水_Happy:
你好,想请教下icon的css是怎么写的?
Primefaces3之p:tree -
weijs:
谢谢,这个文章解决了我的疑问
Jenkins 部署项目到远端的TOMCAT下 -
ljl961890233bear:
<bean id="st ...
springmvc 发送ajax中文乱码的几种解决办法
使用ViewPage+ListView做出如下图的效果:
设计思路如下:
1. 一个总的fragment作为父,三个选项分别也是fragment, 父类布局:
2. 父类里面自定义了adapter,继承了FragmentStatePagerAdapter
3. 父类代码
4. 用于展示的三个子fragment使用LISTVIEW就可以, 配合适配器或自己定义的适配器
注意:如果在每一个item里面还嵌套的有listview的话, 如针对某一个ITEM的多条回复
这个时候ITEM的焦点会被listview获取,有可能出现点item无响应的情况,需要在根目录下加:
设计思路如下:
1. 一个总的fragment作为父,三个选项分别也是fragment, 父类布局:
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/common_title_bg" android:orientation="horizontal"> <LinearLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="4" android:layout_marginTop="10dp" android:layout_marginBottom="10dp" android:layout_marginLeft="15dp" android:layout_marginRight="15dp" android:orientation="horizontal" android:background="@drawable/bg_city_search_selector"> <ImageView android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_marginLeft="15dp" android:src="@drawable/common_search_icon" /> <EditText android:id="@+id/main_hall_search_txt" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="4" android:textSize="15sp" android:maxLength="15" android:singleLine="true" style="@style/common_edit_hint_drawable_style" android:paddingTop="10dp" android:paddingBottom="10dp" android:inputType="textNoSuggestions" android:hint="输入开发商名称" /> <ImageView android:id="@+id/main_hall_search_delete_img" android:layout_width="wrap_content" android:layout_height="match_parent" style="@style/right_icon_class" android:clickable="true" android:src="@drawable/input_right_delete_icon"/> </LinearLayout> <RelativeLayout android:id="@+id/main_hall_cancel_lyt" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:clickable="true" android:gravity="center"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/top_text_big" android:text="@string/common_cancel"/> </RelativeLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="@dimen/main_hall_title_height" android:background="@color/xwhite" android:orientation="horizontal"> <RelativeLayout android:id="@+id/main_hall_search_lyt_0" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:clickable="true" android:gravity="center"> <TextView android:id="@+id/main_hall_txt_0" android:layout_width="match_parent" android:layout_height="match_parent" style="@style/main_hall_search_title" android:text="综合"/> <ImageView android:id="@+id/main_hall_img_0" android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/main_hall_select_style" /> </RelativeLayout> <View android:layout_width="1dp" android:layout_height="match_parent" style="@style/middle_separate_horizontal_style_10"/> <RelativeLayout android:id="@+id/main_hall_search_lyt_1" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:clickable="true"> <TextView android:id="@+id/main_hall_txt_1" android:layout_width="match_parent" android:layout_height="match_parent" style="@style/main_hall_search_title" android:text="好评"/> <ImageView android:id="@+id/main_hall_img_1" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="invisible" style="@style/main_hall_select_style" /> </RelativeLayout> <View android:layout_width="1dp" android:layout_height="match_parent" style="@style/middle_separate_horizontal_style_10"/> <RelativeLayout android:id="@+id/main_hall_search_lyt_2" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:clickable="true"> <TextView android:id="@+id/main_hall_txt_2" android:layout_width="match_parent" android:layout_height="match_parent" style="@style/main_hall_search_title" android:text="砍价次数"/> <ImageView android:id="@+id/main_hall_img_2" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="invisible" style="@style/main_hall_select_style" /> </RelativeLayout> </LinearLayout> <View android:layout_width="match_parent" android:layout_height="1dp" style="@style/middle_separate"/> <android.support.v4.view.ViewPager android:id="@+id/main_hall_search_viewpage" android:layout_width="fill_parent" android:layout_height="fill_parent" />
2. 父类里面自定义了adapter,继承了FragmentStatePagerAdapter
public class LocalFragmentAdapter<T> extends FragmentStatePagerAdapter { private List<T> list; private Activity activity; public LocalFragmentAdapter(Fragment fm, List<T> list, Activity activity) { super(fm.getFragmentManager()); this.list = list; this.activity = activity; } @Override public int getCount() { return list.size(); } @Override public Fragment getItem(int i) { return (Fragment)list.get(i); } //用于刷新数据使用, 获取的查询字段放入缓存变量里面 public void setSearchAndPosition(int currentPageIndex, Editable searchWord) { //用于刷新数据 Fragment fragment = getItem(currentPageIndex); if (!TextUtils.isEmpty(searchWord)) { User.myself.mainHallSearchWord = searchWord.toString(); } else { User.myself.mainHallSearchWord = null; } fragment.onResume(); super.notifyDataSetChanged(); } }
3. 父类代码
//页面滚动 main_hall_search_viewpage.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int i, float v, int i1) { } @Override public void onPageSelected(int position) { changeSelect(position); fragmentAdapter.setSearchAndPosition(currentPageIndex, main_hall_search_txt.getText()); } @Override public void onPageScrollStateChanged(int i) { } }); //搜索字段 main_hall_search_txt.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void afterTextChanged(Editable editable) { fragmentAdapter.setSearchAndPosition(currentPageIndex, editable); } });
4. 用于展示的三个子fragment使用LISTVIEW就可以, 配合适配器或自己定义的适配器
注意:如果在每一个item里面还嵌套的有listview的话, 如针对某一个ITEM的多条回复
这个时候ITEM的焦点会被listview获取,有可能出现点item无响应的情况,需要在根目录下加:
android:descendantFocusability="blocksDescendants"
发表评论
-
如何自己做一个Launcher App
2017-05-18 09:27 0自定义一个自己的Launcher App,并在这个App上控制 ... -
android CPU架构和对应的libs
2017-05-16 17:47 827官网内容: 有如上的几种架构方式,不同的手机使用不 ... -
如何屏蔽HOME,MENU键
2017-05-12 13:40 1016如何屏蔽HOME,MENU键,找了很多答案,下面就是几种办法 ... -
EditText光标随着输入移动
2017-04-26 09:35 1656当前需求如下:点击一个按钮,弹出自定义的键盘,同时输入框内 ... -
调用DialogFragment出现的Can not perform this action after onSaveInstanceState
2017-04-24 09:13 1904代码里面用如下的业务场景:进页面并判断是否签到,没有签到就跳转 ... -
使用自定义的Launcher.apk替代系统的
2017-04-23 08:54 9791.首先使用adb shell命令 ... -
Android避免重复提交的问题
2017-04-06 12:08 632关于某些控件,多次点击导致的重复提交问题,我汇总如下: 1. ... -
使用Retrofit2.0+spingmvc上传图片和参数
2017-03-03 08:58 860如题,使用SPINGMVC接收数据 服务端接口如下 ... -
百度定位 WIFI正常 电信3G出错;Error Code:62
2016-12-22 09:29 1059使用一款4.3系统的手机,在开发过程中发现如下的问题 1.W ... -
关于CPU ABI的一些零碎
2016-08-17 15:18 625首先是一篇文章 关于SO文件你应该知道的 http://ph0 ... -
防止Activity被销毁以后fragment依然存在的问题
2016-08-11 15:49 0App被切换到后台以后,当前的Activity的生命周期 ... -
使用PullToRefreshListView下拉和加载代码
2016-08-05 10:55 1268//三个参数 private int pageNo = ... -
Android连接服务端出现中文乱码的问题
2016-08-01 15:46 543这个是常见问题,我给出我的排查和解决办法。 前提条件 ... -
TextInputLayout的使用
2016-06-14 14:39 1003使用AS发现模板下的 ... -
Android项目代码Inspect Code的各种问题以及集合
2016-05-31 10:22 0一个android项目,使用inspect code,居 ... -
使用Apollo And Mosquitto 作为MQTT Server
2016-05-13 09:56 8951始于环信的消息推送,了解了下目前的几种推送模式,XMP ... -
环信项目分析之2
2016-05-10 14:56 840第二篇主要介绍一下服务端如何与环信进行交互, 环信的官网 ... -
Jersy之路1
2016-05-09 22:00 543关于Jersey2.X 就不巴拉巴拉说这么多废话了。 ... -
环信项目分析之1
2016-05-09 21:32 729系列文章主要是用于分析环信的APP,消息推送等功能。 基 ... -
Okhttp3 学习历程之一
2016-04-27 10:43 1679最近想把一个简单的安卓APP重写一下,写的过程中就涉及到 ...
相关推荐
SlidingMenu+ViewPage+ListView嵌套(类似网易 ) ListView点击事件失效冲突问题解决
Viewpage中添加Listview显示lietview中内容demo
android的viewpager+fragment+listView图片缓存,图片缓存使用开源图片下载框架universal-image-loader
viewpage嵌套listview,效果:滑动listview删除,滑动非listview区域viewpage翻页
Frament+ViewPage+listView实现滑动点击进入第二个Activity效果
其余界面都简单,唯独是淘歌界面有点复杂, ViewPager中嵌套ViewPager+ListView,ListView中还嵌套GridView。由于要整屏滑动,所以在ViewPager+ListView外部嵌套个SrcollView,出现问题了ListView和SrcollView滑动 ...
ListView +ViewPage+Fragmen+TabHost滑动效果,外加上拉刷新,下拉加载更多
新闻首页效果[仿网易](ViewPager+Fragment+ListView), 1.添加fragment对象到fragment列表 2.添加title到title列表 3.从title列表中取出内容放到tabLayout容器中 4.创建并初始化适配器 5.为viewPager设定适配器 6....
ScrollView+ViewPager +ListView或 RecyclerView加载更多
android ViewPage嵌套listview简单的例子
在ViewPage中嵌套listView 进行轮播
功能,实现完美侧滑,解决ViewPage侧滑与ListView滑动的冲突问题
包含有抽屉+fragment、标签+fragment、左右滑动viewpage+fragment、下拉刷新上拉加载
viewpage+fragment+listview解压后可直接运行!
图片无限自动切换的ViewPager,添加为listView的第一个item后,ViewPager左右滑动与ListView上下滑动的焦点切换问题解决。
Android listview viewpager 滑动 跳动 冲突解决 ListView中嵌套ViewPage有或者滑动手势冲突解决 blog 地址 : http://blog.csdn.net/aaawqqq/article/details/43824631
android 通过向viewpage中添加listview来完成滑动效果(类似于qq滑动界面),需要的朋友可以参考一下
ListView +ViewPage+Fragmen+TabHost滑动效果,外加上拉刷新,下拉加载更多 按钮跳转
listView添加ViewPager实现同时滑动
listview viewpage addheaderview 下载即可运行