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). ...
随机推荐
- C#后台验证身份证号码的一个方法
简单的调用了正则表达式进行简单的验证,记下来留着以后备用 if ((!Regex.IsMatch(txtID.Text, @"^(^\d{15}$|^\d{18}$|^\d{17}(\d|X ...
- ABI Management
官方文档:https://developer.android.com/ndk/guides/abis.html?hl=is 关于支持指令集,在上表官方文档都表达清楚了.我们认为避免多个指令集浪费资源. ...
- nginx上搭建HLS流媒体服务器
http://blog.csdn.net/cjsafty/article/details/7922849 简介:HTTP Live Streaming(缩写是 HLS)是一个由苹果公司提出的基于HTT ...
- SQL Server系统表sysobjects介绍与使用(转)
SQL Server系统表sysobjects介绍与使用 关于SQL Server数据库的一切信息都保存在它的系统表格里.我怀疑你是否花过比较多的时间来检查系统表格,因为你总是忙于用户表格.但是,你可 ...
- initialize 和init
initialize 是类方法,创建实例时会调用该方法.但是只会调用一次.如一个类创建了10个对象,initialize方法只会调用一次,但是init会调用10次.init 是实例方法,每次创建一个实 ...
- CSS 的选择符
CSS是什么? 如果说元素是标记代码的构建块料,那么CSS就是约束这些构建块料样式的规则. CSS规则的组成 CSS的规则由 选择符 和属性,值组成. Css选择符:选择符是规则中用于确定样式所涵盖的 ...
- javascript Window对象 第16节
<html> <head> <title>浏览器对象</title> <script type="text/javascript&quo ...
- DAG模型——硬币问题
硬币问题 有n种硬币,面值分别为V1,V2,...,Vn,每种都有无限多.给定非负整数S,可以选用多少个硬币,使得面值之和恰好为S?输出硬币数目的最小值和最大值.1<=n<=100, 0& ...
- Leetcode Count Prime
Description: Count the number of prime numbers less than a non-negative number, n Hint: The number n ...
- Android从服务端获取json解析显示在客户端上面
Android从服务端获取json解析显示在客户端上面 百度经验:jingyan.baidu.com 首先说一下Json数据的最基本的特点,Json数据是一系列的键值对的集合,和XML数据来比,Jso ...