Android 如何在viewpager中添加这样的view viewpagerandroid 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 给这个listview添加footview啊。listView.addFootView(); 直接在布局文件上改啊, 把 ViewPager 放在 LinearLayout 里面, 在 ViewPager 控件下面放一个 TextView 啊 既然你listview高度写死了 , 在下面加个textview不就可以了吗。。这个应该很简单吧,还是我理解的有问题? 你textview是要加在listview下面,还是ViewPager 下面? 只用用Relativelayout,在textview放在底部,listview在他的上边 可能我表达有误,我只是想单独在第二个页面中添加这样的TextView。 这样的布局之后,那我再MainActivity中怎么添加这个view呢。是不是需要先定义一个类,然后将我需要的view绘制出来,返回,然后在上述代码中调用viewpager的add方法添加这个view? 请教,下面和上面有什么区别?是不是如果在下面,有能够直接使用的api。我主要就是想实现滑动listview的时候,这个textview保持不动。 请教,下面和上面有什么区别?是不是如果在下面,有能够直接使用的api。我主要就是想实现滑动listview的时候,这个textview保持不动。如果是在listview下加,就使用listView的addFooterView方法,如果是layout下的话,使用<include layout="@layout/footer" />,根据你的需求,应该使用后者。 请教,下面和上面有什么区别?是不是如果在下面,有能够直接使用的api。我主要就是想实现滑动listview的时候,这个textview保持不动。如果是在listview下加,就使用listView的addFooterView方法,如果是layout下的话,使用<include layout="@layout/footer" />,根据你的需求,应该使用后者。试了一下貌似还不行。<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ListView android:id="@+id/page2_list" android:layout_height="50dip" android:layout_width="fill_parent" android:background="#EDEDED" ></ListView> <include layout="@layout/pager2_foot"/> </LinearLayout> 请教,下面和上面有什么区别?是不是如果在下面,有能够直接使用的api。我主要就是想实现滑动listview的时候,这个textview保持不动。如果是在listview下加,就使用listView的addFooterView方法,如果是layout下的话,使用<include layout="@layout/footer" />,根据你的需求,应该使用后者。试了一下貌似还不行。<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ListView android:id="@+id/page2_list" android:layout_height="50dip" android:layout_width="fill_parent" android:background="#EDEDED" ></ListView> <include layout="@layout/pager2_foot"/> </LinearLayout>将LinearLayout 改为RelativeLayout <?xml version="1.0" encoding="utf-8"?><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <ListView android:id="@+id/page2_list" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#EDEDED" > </ListView> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:gravity="center" /></FrameLayout> 请教,下面和上面有什么区别?是不是如果在下面,有能够直接使用的api。我主要就是想实现滑动listview的时候,这个textview保持不动。如果是在listview下加,就使用listView的addFooterView方法,如果是layout下的话,使用<include layout="@layout/footer" />,根据你的需求,应该使用后者。试了一下貌似还不行。<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ListView android:id="@+id/page2_list" android:layout_height="50dip" android:layout_width="fill_parent" android:background="#EDEDED" ></ListView> <include layout="@layout/pager2_foot"/> </LinearLayout>将LinearLayout 改为RelativeLayout除此以外,我还需要在MainActivity中做怎样的修改,现在,我viewpager中第二页直接使用的是ListView,代码如上,该如何修改?谢谢指导。 将listview和textview分开来看,各自负责显示,只是在一个layout里面定义而已 有个demo就好了。谢谢。少年,你把LinearLayout换成FrameLayout 就可以了,12L 我要做一个“甩一甩”这样的应用,请问下这其中的传感器怎么设置呢? android闹钟重复的问题 有谁在android中用过scriptengineManager这个API没有? adb shell 如何做任务切换 求高手解决:如何静默更新自己的APK,而不要弹出提示 关于android usb驱动的研究 一个奇怪的问题!求解 android使用socket向服务器发送图片失败 实习在做一个电台的app,现场转播,有几个问题 安卓记住密码登陆后按下back键密码不见 求解,移动网络NET速度慢的问题 listview下拉直接置顶,上拉正常,请各位大神帮忙看一下
如果是在listview下加,就使用listView的addFooterView方法,如果是layout下的话,使用<include layout="@layout/footer" />,根据你的需求,应该使用后者。
如果是在listview下加,就使用listView的addFooterView方法,如果是layout下的话,使用<include layout="@layout/footer" />,根据你的需求,应该使用后者。
试了一下貌似还不行。<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/page2_list"
android:layout_height="50dip"
android:layout_width="fill_parent"
android:background="#EDEDED"
></ListView>
<include layout="@layout/pager2_foot"/>
</LinearLayout>
如果是在listview下加,就使用listView的addFooterView方法,如果是layout下的话,使用<include layout="@layout/footer" />,根据你的需求,应该使用后者。
试了一下貌似还不行。<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/page2_list"
android:layout_height="50dip"
android:layout_width="fill_parent"
android:background="#EDEDED"
></ListView>
<include layout="@layout/pager2_foot"/>
</LinearLayout>
将LinearLayout 改为RelativeLayout
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" > <ListView
android:id="@+id/page2_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#EDEDED" >
</ListView> <TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:gravity="center" /></FrameLayout>
如果是在listview下加,就使用listView的addFooterView方法,如果是layout下的话,使用<include layout="@layout/footer" />,根据你的需求,应该使用后者。
试了一下貌似还不行。<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/page2_list"
android:layout_height="50dip"
android:layout_width="fill_parent"
android:background="#EDEDED"
></ListView>
<include layout="@layout/pager2_foot"/>
</LinearLayout>
将LinearLayout 改为RelativeLayout
除此以外,我还需要在MainActivity中做怎样的修改,现在,我viewpager中第二页直接使用的是ListView,代码如上,该如何修改?谢谢指导。
少年,你把LinearLayout换成FrameLayout 就可以了,12L