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
谢谢大家的支持。脱鞍暂入酒家垆,送君万里西击胡
标签:
Android
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了