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

  • 相关阅读:
    训练深度学习网络时候,出现Nan 或者 震荡
    Jupyter Notebook 的快捷键
    pyspark RandomForestRegressor 随机森林回归
    深度学习图像标注工具VGG Image Annotator (VIA)使用教程
    python 中 with 用法
    python 报错 SyntaxError: Non-ASCII character
    YOLO 详解
    Spark与Pandas中DataFrame对比
    利用WGET下载文件,并保存到指定目录
    http 三次握手
  • 原文地址:https://www.cnblogs.com/newlist/p/2686829.html
Copyright © 2011-2022 走看看