码迷,mamicode.com
首页 > 移动开发 > 详细

熟悉AndroidAPI系列1——LinearLayout

时间:2014-12-26 21:31:57      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:

<?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" >
    
    <TextView 
        android:layout_width = "match_parent"
        android:layout_height = "wrap_content"
        android:background="#00FF00"
        android:text = "第一个textview"/>
    
    <TextView 
        android:layout_width = "match_parent"
        android:layout_height = "wrap_content"
        android:background="#FF0000"
        android:text = "第二个textview"/>

</LinearLayout>
package com.njulya.firstprj;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.first_layout);
    }

    @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;
    }

}

 

熟悉AndroidAPI系列1——LinearLayout

标签:

原文地址:http://www.cnblogs.com/lya-nju/p/4187507.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!