newlist

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

strings.xml

<resources>

    <string name="app_name">FrameTest</string>
    <string name="hello_world">Hello world!</string>
    <string name="menu_settings">Settings</string>
    <string name="title_activity_main">MainActivity</string>
 <string name="big">big</string>
 <string name="small">small</string>
 <string name="middle">middle</string>
</resources>

colors.xml

<?xml version="1.0" encoding="utf-8" ?>
<resources>
   
    <color name="red">#6400FF00</color>
    <color name="green">#64FF0000</color>
    <color name="blue">#640000FF</color>
    <color name="white">#FFFFFF</color>
    <color name="black">#000000</color>
</resources>

activity_main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:background="@color/white"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <FrameLayout
        android:id="@+id/FrameLayout01"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >
    <TextView
        android:text="@string/small"
        android:id="@+id/TextView01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="24dip"
        android:textStyle="bold"
        android:textColor="@color/red"
        />
    <TextView
        android:text="@string/big"
        android:id="@+id/TextView03"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="@color/blue"
        android:textSize="60dip"
        android:textStyle="bold"
        ></TextView>

</FrameLayout>
</LinearLayout>

MainActivity.java

package com.example.frametest;

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

public class MainActivity extends Activity {

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

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}

posted on 2012-09-15 17:44  一枚程序  阅读(486)  评论(0编辑  收藏  举报