Android 微信UI 、点击操作

  上一篇,我们介绍了微信界面的相关知识点。今天我们就来把微信的界面做出来。

  首先我们新建一个layout-->LinearLayout-->weixin.xml

  我们使用上中下线性布局,采用include 包含布局

<?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" >
    <!-- head -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
        <include layout="@layout/head"/>
    </LinearLayout>
    
    <!-- 中间 -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
        android:layout_weight="1">                <!-- 用于站位空格 -->
    </LinearLayout>
    
    <!-- 底部 -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
        <include layout="@layout/bottom"/>
    </LinearLayout>

</LinearLayout>

  实现head,新建一个layout -->LinearLayout-->head.xml

<?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="50dp"
    android:orientation="horizontal" 
    android:background="#21292c">

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/weixin"
        android:textColor="#ffffff"
        android:textSize="20sp"
        android:layout_gravity="center" 
        android:padding="10dp"/>
    <TextView 
         android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"/>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent" 
        android:gravity="center">

        <ImageView
            android:id="@+id/imageView2"
            android:layout_width="40dp"
            android:layout_height="30dp"
            android:src="@drawable/fdj" 
            android:layout_marginRight="10dp"/>

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="40dp"
            android:layout_height="30dp"
            android:src="@drawable/barbuttonicon_add" />
        
    </LinearLayout>

</LinearLayout>

            

  实现buttom,新建一个layout -->LinearLayout-->buttom.xml

<?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="horizontal" >

    <RadioGroup
        android:id="@+id/radioGroup1"
        android:layout_width="match_parent"
        android:layout_height="60dp" 
        android:orientation="horizontal"
        android:background="@drawable/group_buton_nomal"
        android:gravity="center">

        <RadioButton
            android:id="@+id/radio0"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checked="true"
            android:text="@string/weixin" 
               style="@style/radioStyle"
               android:drawableTop="@drawable/tab_weixin"/>

        <RadioButton
            android:id="@+id/radio1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/addressList" 
               style="@style/radioStyle"
               android:drawableTop="@drawable/tab_address"/>

        <RadioButton
            android:id="@+id/radio2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/find" 
               style="@style/radioStyle"
               android:drawableTop="@drawable/tab_find"/>
        
         <RadioButton
            android:id="@+id/radio3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/set"
               style="@style/radioStyle" 
               android:drawableTop="@drawable/tab_set"/>
    </RadioGroup>

</LinearLayout>

          

写完之后,我们来看一下总体的效果:

  

    

  上一篇:Android RadioGroup 及资源文件 http://www.cnblogs.com/hxb2016/p/6097004.html

   谢谢大家的支持。脱鞍暂入酒家垆,送君万里西击胡

原文地址:https://www.cnblogs.com/hxb2016/p/6097870.html