android微信简单界面
这几天没事做了一个简单的菜单布局,在这里我没有添加任何的功能只是做了一个简单的布局。看着还可以,就想着与大家分享一下。
代码如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:orientation="horizontal"
android:background="@drawable/beijing" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="4dp"
android:layout_marginLeft="25dp"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:src="@drawable/ic_launcher" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="微信"
android:textSize="10sp"
android:layout_marginLeft="12dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="35dp"
android:layout_marginTop="4dp"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:src="@drawable/ic_launcher" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:text="通讯录"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="4dp"
android:layout_marginLeft="35dp"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView2"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:src="@drawable/ic_launcher" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="发现"
android:textSize="10sp"
android:layout_marginLeft="12dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="4dp"
android:layout_marginLeft="35dp"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView3"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:src="@drawable/ic_launcher" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10sp"
android:layout_marginLeft="14dp"
android:text="我" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
说明:在这里主要练习的是空间之间的布局。还有就是空间之间是如何跟好的联系起来的。
1、首先用LinearLayout进行分块,使得将整个的布局,变成一个一个使用的块,然后就是添加控件了,ImageView使图片视图控件,TextView是文字视图控件。
是由一个图片控件和一个文字视图控件组成的,并且在一个LinearLayout里面。
效果图如下:
:
最新文章
- JSP+Servlet中使用jspsmartupload.jar进行图片上传下载
- SAP打印出库单需求
- Web服务器异常问题记录
- 【JPA】query新对象 需要 构造函数
- chart.js 示例
- excel中的数据导入oracle方法
- 关于oracle数据库(4)数据类型
- ArcGIS API for JavaScript 4.2学习笔记[27] 网络分析之最短路径分析【RouteTask类】
- Java基础语法<;五>; 大数值BigInteger BigDecimal
- css基本介绍
- TopCoder SRM500 Div1 250 其他
- SpringCloud学习6-如何创建一个服务消费者consumer
- CodeSignal 刷题 —— matrixElementSum
- [ci]jenkins server启动,通过jnlp的方式启动slave(容器模式)
- HTML5 drawImage性能问题
- Linux的fork()写时复制原则(转)
- the unchecked warnings
- Hibernate常见配置详细解释
- hdu5731
- TCP/IP笔记(八)应用层协议