今天我们开始android之旅,由于本人现在水平还很菜,只能从简单的做起,希望各位老鸟多多指点;今天我们要学的是android的布局,各种布局管理器

先看效果图:



代码如下:

main.xml 主要用来做界面的布局

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"   android:orientation="vertical"   android:layout_width="fill_parent"    android:layout_height="wrap_content"> <Button       android:layout_width="fill_parent"       android:layout_height="fill_parent"       android:text="上"    />                <!-- 向线性布局中添加一个普通按钮控件 --><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:orientation="horizontal"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    >  <!-- 向线性布局中添加一个水平的线性布局 -->    <Button    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:text="左下"    />    <Button        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="右下"    />   </LinearLayout></LinearLayout>

实现的功能:

package com.qinweiping;import android.app.Activity;import android.os.Bundle;public class Sample_2_1Activity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }}

更多相关文章

  1. Android(安卓)ListView 之 SimpleAdapter 一
  2. Android(安卓)内存泄漏LeakCanary使用详解
  3. Android入门之addWindow
  4. Android(安卓)listview多选模式ChoiceMode
  5. 在Android(安卓)Studio上使用lambda
  6. Android动态设置控件大小
  7. Android(安卓)Fragment实践之简易的新闻应用
  8. 记android输入框添加删除功能
  9. Android(安卓)ListView分页加载数据Demo

随机推荐

  1. SQL Server 版本变更检查 警告
  2. SQL 实用语句
  3. SQLServer 数据库中如何保持数据一致性
  4. MsSql 存储过程分页代码 [收集多篇]
  5. SqlServer 序号列的实现方法
  6. 丢失的数据忘记备份的处理方法[图文]第1/
  7. SQL SERVER 自增列
  8. sql 多表连接查询
  9. sqlserver 系统存储过程 中文说明
  10. 分页查询 效率最高