复写一个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啊?的更多相关文章

  1. Android 自学之线性布局 LinearLayout

    线性布局(LinearLayout),线性布局有点想AWT编程里面的FolwLayout,他们都会将容器里面的组件挨个的排列起来. 他们最大的区别在于:Android的线性布局不会换行:AWT里面的F ...

  2. Android开发之线性布局详解(布局权重)

    布局权重 线性布局支持给个别的子视图设定权重,通过android:layout_weight属性.就一个视图在屏幕上占多大的空间而言,这个属性给其设 定了一个重要的值.一个大的权重值,允许它扩大到填充 ...

  3. .Net程序猿玩转Android开发---(6)线性布局LinearLayout

                                LinearLayout控件是Android中重要的布局控件,是一个线性控件,所谓线性控件的意思是指该控件里面的内容仅仅能水平或垂直排列.也就 ...

  4. android 59 LinearLayout 线性布局

    ##常见的布局* LinearLayout 线性布局线性布局往左右拉是拉不动的,> 线性布局的朝向 vertical|horizontal> 线性布局的权重 weight 和 0dip一起 ...

  5. android学习之线性布局

    效图如下 移通152余继彪 该布局使用了线性布局完成 父布局为线性布局,黄色和灰色部分为水平的线性布局,剩余50%部分为水平线性布局,该布局中包含了两个垂直的线性布局分别占了三分之1和三分之二

  6. Android之Linearlayouy线性布局

    写了个小例子xml代码如下: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout x ...

  7. Android之LinearLayout线性布局

    1.相关术语解释 orientation 子控件的排列方式,horizontal(水平)和vertical(垂直默认)两种方式! gravity 子控件的对齐方式,多个组合 layout_gravit ...

  8. Android开发:在布局里移动ImageView控件

    在做一个app时碰到需要移动一个图案的位置,查了一上午资料都没找到demo,自己写一个吧 RelativeLayout.LayoutParams lp = new RelativeLayout.Lay ...

  9. Android——学习:线性布局权重分配

    LinearLayout在Android中被广泛使用,LinearLayout有一个比较重要的属性——android:layout_weight.按照字面理解就是该控件的权重,这个值默认是 零(0). ...

随机推荐

  1. Git之路--2

  2. Socket的3次握手链接与4次断开握手

    http://blog.sina.com.cn/s/blog_810c860001018tir.html 连接握手: 1.客户端发送建立连接请求 2.服务端确认连接请求 3.客户端确认已经连接 以上3 ...

  3. 从入行到现在(.net)

    每次写东西都不知道怎么去开头.因为一想到要写东西.脑子里面浮现出来的开头就太多. 进园子很久从开始只是关注别人讲的技术,别人讲的基础,到现在更多的去看大家的随笔和新闻.这两年我从零基础的外行人逐渐进入 ...

  4. C语言study一

    之前看了CPP,敲过些代码,但总觉得学得不够系统,书后面的习题比较无聊,不想去写.C主要在学数据结构和理解底层上面很有帮助. 于是又来mooc学习C语言,看了下视频虽然很繁琐啰嗦,但是有些东西我确实以 ...

  5. sql server 的JDBC 配置

    1.java中使用数据库需要用JDBC(java database connection)来连接和操作 下载地址:http://www.microsoft.com/en-us/download/det ...

  6. RAC分解步骤之一,在oracle linux 4u4上安装oracle 10.2.0.1.0操作日志

    练习oracle的rac组建过程,第一步,先练习4u4上安装oracle 10.2.0.1.0.直接安装rac,有些难度.从简单的做起.总RAC步骤,参照小布老师的RAC组建. 1. 启动vc,登陆v ...

  7. 暑假集训(2)第二弹 ----- The Suspects(POJ1611)

    B - The Suspects Crawling in process... Crawling failed Time Limit:1000MS     Memory Limit:20000KB   ...

  8. ubuntu下编译安装apache

    官网http://httpd.apache.org/download.cgi下载apache源码包后 /*解包*/ gzip -d httpd-2_x_NN.tar.gz tar -xf httpd- ...

  9. problem 1 -- Two sum

    很简单.没什么好说的.但是在阿里实习的第四面的时候居然问到了. 大意是给出一组无序数列和目标数Z,在无序数列中找到X和Y,使得X+Y=Z. 有两种方法: 一种是排序后,同时首尾搜索.时间复杂度为O(n ...

  10. 易买网(注册Ajax讲解)

    关于注册(用到Ajax) 运用onblur进行时时刷新 创建所需用的Servlet 好了 Ajax其实不是很难  如果还是不懂可以私信我呦-^^-!