zoukankan      html  css  js  c++  java
  • android笔记三FrameLayout

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

  • 相关阅读:
    图的存储结构(精编)
    二叉树的输入
    哈夫曼树及编码
    C. Bits (Codeforces Round #276 (Div. 2) )
    C++ Map 容器
    POJ 1080 Human Gene Functions(dp)
    数和二叉树——二叉树的建立及应用(遍历等)(基础篇)
    数独问题的介绍及POJ 2676-Sudoku(dfs+剪枝)
    【数据结构】——稀疏矩阵转置
    POJ 3083 Children of the Candy Corn
  • 原文地址:https://www.cnblogs.com/newlist/p/2686829.html
Copyright © 2011-2022 走看看