listView 一个简单的Item布局

        很久没写博客了,想把它养成一种习惯,却一直没养成,记起来了就到这来写一写。

         废话不多说了,进入正题吧。因为一直做功能,ui界面不是很拿手(比较菜),现在公司没有了ui,那只能自己写(苦逼)。

 写一个listView填充Item的ui   半天不能适配各种分辨率,无奈只能求助现场观众(我们andBase群的一个好心大哥),要他指点一下我,结果三下五除二就弄出来了,且各种分辨率可适配,果然是菜鸟于高手的区别啊!上代码吧


下面是效果图: 


<?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="wrap_content"
    android:orientation="vertical"
    android:background="#fff" >
    <RelativeLayout 
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
	    <LinearLayout 
		    android:layout_width="match_parent"
		    android:layout_height="wrap_content"
		    android:layout_marginTop="18dp"
		    android:layout_marginLeft="14dp"
		    android:orientation="horizontal" >
	        <ImageView
	            android:id="@+id/attention_imageView_log"
			    android:layout_width="76dp"
			    android:layout_height="76dp"
			    android:layout_marginRight="10dp"
			    android:src="@drawable/azhong_weixin"/>
	        
	        <LinearLayout 
	            android:layout_width="wrap_content"
	            android:layout_height="wrap_content"
	            android:orientation="vertical">
	            <TextView
	                android:layout_width="wrap_content"
	                android:layout_height="wrap_content"
	                android:text="签到任务"
	                android:textColor="@color/black"
	                android:textSize="14sp" />
	            <LinearLayout
	                android:layout_width="wrap_content"
	                android:layout_height="wrap_content"
	                android:layout_marginTop="12dp"
	                android:orientation="horizontal" >
	                <ImageView 
		                android:layout_width="wrap_content"
		                android:layout_height="wrap_content"
		                android:src="@drawable/attention_rawad"/>
	                <TextView 
		                android:layout_width="wrap_content"
		                android:layout_height="wrap_content"
		                android:layout_marginLeft="8dp"
		                android:textSize="13sp"
		                android:textColor="@color/red"
		                android:text="@string/attention_award"/>
	            </LinearLayout>
	            <LinearLayout
	                android:layout_width="wrap_content"
	                android:layout_height="wrap_content"
	                android:layout_marginTop="8dp"
	                android:orientation="horizontal" >
	                <TextView 
		                android:layout_width="wrap_content"
		                android:layout_height="wrap_content"
		                android:layout_marginLeft="47dp"
		                android:textSize="13sp"
		                android:textColor="@color/red"
		                android:text="@string/attention_tiem"/>
	            </LinearLayout>
	        </LinearLayout>
	        
	    </LinearLayout>
	    
	    <TextView 
	        android:id="@+id/attention_tv_go"
	        android:layout_width="65dp"
	        android:layout_height="30dp"
	       	android:layout_alignParentRight="true"
	       	android:layout_marginTop="12dp"
	       	android:layout_marginRight="16dp"
	        android:gravity="center"
	        android:text="保存"
	        android:textSize="16sp"
	        android:textColor="#fff"
	        android:background="#00a6f0"/>
        
    </RelativeLayout>
    
    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_marginTop="19dp"
        android:background="#f5f5f5" />
	
    <LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="13dp"
        android:layout_marginBottom="12dp"
        android:layout_marginLeft="9dp"
        android:layout_marginRight="9dp"
        android:orientation="vertical">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:singleLine="true"
            android:textColor="#888"
            android:textSize="14sp"
            android:text="@string/attention_step1"
            android:drawableLeft="@drawable/attention_1"
            android:drawablePadding="6dp" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:singleLine="true"
            android:textColor="#888"
            android:textSize="14sp"
            android:text="@string/attention_step2"
            android:drawableLeft="@drawable/attention_2"
            android:drawablePadding="6dp" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:singleLine="true"
            android:textColor="#888"
            android:textSize="14sp"
            android:text="@string/attention_step3"
            android:drawableLeft="@drawable/attention_3"
            android:drawablePadding="6dp" />
    </LinearLayout>
    
</LinearLayout>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值