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

ANDROID_MARS学习笔记_S01_003layout初步

时间:2016-02-07 13:33:45      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:

一、layout介绍

技术分享技术分享

二、测试linear_layout
1.activity_main.xml

<?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="horizontal" >
    <TextView 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="#ff0000"
        android:text="第一个"/>
    <TextView 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="#0000ff"
        android:text="第二个"/>

</LinearLayout>

  

2.MainActivity.java

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

 

  

 

ANDROID_MARS学习笔记_S01_003layout初步

标签:

原文地址:http://www.cnblogs.com/shamgod/p/5184587.html

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