Demo06:LinearLayout
来源:互联网 发布:中银淘宝卡办理 编辑:程序博客网 时间:2024/06/07 10:22
package com.wuqiong.demo06;import android.app.Activity;import android.os.Bundle;import android.view.Menu;import android.view.MenuItem;public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }}
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"android:orientation="vertical" ><LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:orientation="horizontal" > <TextView android:id="@+id/text_view1" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#aa0000" android:text="red"/> <TextView android:id="@+id/text_view2" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#00aa00" android:text="green"/> <TextView android:id="@+id/text_view3" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#0000aa" android:text="blue"/> <TextView android:id="@+id/text_view4" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#aaaa00" android:text="yellow"/></LinearLayout><LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:orientation="vertical" > <TextView android:id="@+id/text_view5" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:textSize="30sp" android:text="row one" /> <TextView android:id="@+id/text_view6" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:textSize="30sp" android:text="row two" /> <TextView android:id="@+id/text_view7" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:textSize="30sp" android:text="row three" /> <TextView android:id="@+id/text_view8" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:textSize="30sp" android:text="row four" /></LinearLayout></LinearLayout>
0 0
- Demo06:LinearLayout
- demo06--求圆周率
- Demo06三目运算
- LinearLayout
- LinearLayout
- Linearlayout
- LinearLayout
- LinearLayout
- LinearLayout
- Linearlayout
- LinearLayout
- LinearLayout
- LinearLayout
- LinearLayout
- LinearLayout
- LinearLayout
- LinearLayout
- LinearLayout
- ubuntu 编译环境搭建
- UVa1363 - Joseph's Problem(数论)
- day19/MyBufferedReaderDemo.java
- osfp rip bgp在osi协议层哪
- day19/ReadIn.java
- Demo06:LinearLayout
- UVA12003.Array Transformer——分块
- struts学习之说trust2开发流程
- Java常见错误列表
- day19/StreamCopyMp3.java
- CentOS设置打开终端快捷键
- C++ 智能指针详解
- 经典题目short s=1;s=s+1;与short s=1;s+=1;的区别
- day19/StreamCopyPic.java