Android如何在一个线性布局里完美显示两个listview啊?
复写一个listView ,在你布局文件中使用此view:
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_30_dp"
android:fadingEdge="none" > <LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical" > <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="@dimen/size_12_dp"
android:text="@string/text_task_personal"
android:textColor="@color/text_task_personal_color"
android:textSize="@dimen/size_16" /> <com.xxx.view.MyListView
android:id="@+id/gtask_listview_doing"
style="@style/inventory_view_list_style"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/detail_top"
android:background="@color/white" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="@dimen/size_12_dp"
android:text="@string/text_task_team"
android:textColor="@color/text_task_team_color"
android:textSize="@dimen/size_16" /> <com.xxx.view.MyListView
android:id="@+id/gtask_listview_finished"
style="@style/inventory_view_list_style"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/detail_top"
android:background="@color/white" />
</LinearLayout>
</ScrollView>
java代码:
package com.xxx.view;
import android.content.Context;
import android.widget.ListView; public class MyListView extends ListView {
public MyListView(Context context) {
super(context);
} public MyListView(Context context, android.util.AttributeSet attrs) {
super(context, attrs);
} public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE>> , MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
}
Android如何在一个线性布局里完美显示两个listview啊?的更多相关文章
- Android 自学之线性布局 LinearLayout
线性布局(LinearLayout),线性布局有点想AWT编程里面的FolwLayout,他们都会将容器里面的组件挨个的排列起来. 他们最大的区别在于:Android的线性布局不会换行:AWT里面的F ...
- Android开发之线性布局详解(布局权重)
布局权重 线性布局支持给个别的子视图设定权重,通过android:layout_weight属性.就一个视图在屏幕上占多大的空间而言,这个属性给其设 定了一个重要的值.一个大的权重值,允许它扩大到填充 ...
- .Net程序猿玩转Android开发---(6)线性布局LinearLayout
LinearLayout控件是Android中重要的布局控件,是一个线性控件,所谓线性控件的意思是指该控件里面的内容仅仅能水平或垂直排列.也就 ...
- android 59 LinearLayout 线性布局
##常见的布局* LinearLayout 线性布局线性布局往左右拉是拉不动的,> 线性布局的朝向 vertical|horizontal> 线性布局的权重 weight 和 0dip一起 ...
- android学习之线性布局
效图如下 移通152余继彪 该布局使用了线性布局完成 父布局为线性布局,黄色和灰色部分为水平的线性布局,剩余50%部分为水平线性布局,该布局中包含了两个垂直的线性布局分别占了三分之1和三分之二
- Android之Linearlayouy线性布局
写了个小例子xml代码如下: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout x ...
- Android之LinearLayout线性布局
1.相关术语解释 orientation 子控件的排列方式,horizontal(水平)和vertical(垂直默认)两种方式! gravity 子控件的对齐方式,多个组合 layout_gravit ...
- Android开发:在布局里移动ImageView控件
在做一个app时碰到需要移动一个图案的位置,查了一上午资料都没找到demo,自己写一个吧 RelativeLayout.LayoutParams lp = new RelativeLayout.Lay ...
- Android——学习:线性布局权重分配
LinearLayout在Android中被广泛使用,LinearLayout有一个比较重要的属性——android:layout_weight.按照字面理解就是该控件的权重,这个值默认是 零(0). ...
随机推荐
- 无法启动调试--未安装 Silverlight Developer 运行时。请安装一个匹配版本。
引自:http://www.cnblogs.com/chillsrc/archive/2010/06/28/1766816.html 安装完VS2010中文版之后,又安装了Silverlight4_T ...
- JS实现跳转到页面任何地方
要实现两个内容: 1.从A页面跳转到B页面任何地方 方法:用id对要跳转的地方进行标记. 首先,在A页面可以设一个链接 <a href = "b.html#pos" targ ...
- 18、HTML
HTML 超文本标记语言(Hyper Text Markup Language). 用来描述网页的一种语言. HTML标签 由尖括号包围的关键词. 如:<html> 通常是成对出现的,开始 ...
- ajax 特殊参数值无法传到后台问题
用原生的ajax请求后台的登录功能,使用特殊字符作为密码的时候发现无法把参数传到后台;发现前端就报错了.可能是因为特殊符号吧. 用 encodeURIComponent() 这个方法进行编码之后就可以 ...
- 几种工具反编译被编译好的DLL文件
我们平时在工作中经常会遇到一些已经被编译后的DLL,而且更加麻烦是没有源代码可以进行修改,只能针对这个DLL的文件进行修改才能得到我们想要的结果:本文将通过一个实例来演示如果完成一个简单的修改;我们将 ...
- JavaScript高级程序设计(二):在HTML中使用JavaScript
一.使用<script>元素 1.<script>元素定义了6个属性: async:可选.表示应该立即下载脚本,但不应该妨碍页面中的其他操作,比如下载其他资源或等待加载其他脚本 ...
- Code::Blocks开发中的字符串编码错误
刚开始使用Code::Blocks开发Windows中文应用程序的朋友们,如果在代码中使用了中文字符串,编译时可能遇到过Illegal byte sequence或Failure to convert ...
- std::map的操作:插入、修改、删除和遍历
using namespace std; std::map<int,int> m_map; 1.添加 for(int i=0;i<10;i++) { m_map.insert(mak ...
- 九度OJ 1434 今年暑假不AC
题目地址:http://ac.jobdu.com/problem.php?pid=1434 题目描述: “今年暑假不AC?”“是的.”“那你干什么呢?”“看世界杯呀,笨蛋!”“@#$%^&*% ...
- 使用CPA4破解经典密码算法
下面是一段经过经典密码算法加密的密文(加密算法未知): yvvnerujjvnywhbdvkpchfgvjtzwqsuporqfzpoekkjgziicdwwkeejdsruef whwseyej ...