androi
来源:互联网 发布:62078端口 编辑:程序博客网 时间:2024/05/01 08:28
这几天没事做了一个简单的菜单布局,在这里我没有添加任何的功能只是做了一个简单的布局。看着还可以,就想着与大家分享一下。
代码如下:
<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里面。
效果图如下:
:
- androi
- androi 适配
- Androi blog
- Androi CheckBox
- androi截屏
- Androi 开发技巧
- Androi UI Intent
- androi中xliff:g
- androi背景设置
- Androi SQL语句注意事项
- androi 图片自由拼接
- Androi系统设置Table
- androi.mk 分析
- androi java条件编译
- androi surfaceview and camera
- androi 系统优化
- Androi之Canvas drawText
- android - androi…
- jenkins
- JSON和JSONP
- Android问题集锦之二十六:AndroidManifest相关的警告
- mysql将索引到处成oracle
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- androi
- linux下C语言多线程编程
- HBase查询引擎——Phoenix的使用
- SortdeList的用法大全
- DFT和FFT运算效率对比
- SQL Server游标的使用
- vim 配置关联多个tags文件
- php将XML转成数组
- Bellman-Ford算法模板题——POJ 3259