zoukankan      html  css  js  c++  java
  • android学习笔记03(RelativeLayout)

    java类:

    package tk.layout_03;
    
    import android.os.Bundle; 
    import android.app.Activity; 
    import android.view.Menu;
    
    public class Layout03 extends Activity {
    
        @Override 
        public void onCreate(Bundle savedInstanceState) { 
            super.onCreate(savedInstanceState); 
            setContentView(R.layout.layout03); 
        }
    
        @Override 
        public boolean onCreateOptionsMenu(Menu menu) { 
            getMenuInflater().inflate(R.menu.layout03, menu); 
            return true; 
        } 
    }

    XML文件:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
        xmlns:tools="http://schemas.android.com/tools" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" >
    
        <TextView 
            android:id="@ id/label" 
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" 
            android:text="Type here:" 
            ></TextView> 
        <EditText 
            android:id="@ id/entry" 
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" 
            android:background="@android:drawable/editbox_background" 
            android:layout_below="@id/label" 
            /> 
        <Button 
            android:id="@ id/ok" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_below="@id/entry" 
            android:layout_alignParentRight="true" 
            android:layout_marginLeft="10px" 
            android:text="OK" 
            /> 
        <Button 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_toLeftOf="@id/ok" 
            android:layout_alignTop="@id/ok" 
            android:text="Cancel" 
            /> 
        
    </RelativeLayout>
  • 相关阅读:
    2013,爱上暗色调
    [转]Sublime Text 使用介绍、全套快捷键及插件推荐
    委托、事件
    ASP.NET中常用的三十三种代码 .NET技术 / ASP.NET
    台湾综艺节目
    C# 中的委托和事件
    ASP.net 静态化页面之的URL重写
    源码
    毕业5年决定你的一生
    常见错误 不能打开注册表关键字
  • 原文地址:https://www.cnblogs.com/tiankonguse/p/2610785.html
Copyright © 2011-2022 走看看