zoukankan      html  css  js  c++  java
  • android笔记四RelativeLayout

    activity_main.xml

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/RelativeLayout01"
        android:gravity="center"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <ImageView
            android:id="@+id/ImageView01"
            android:background="@drawable/center"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            />
        <ImageView
            android:id="@+id/ImageView02"
            android:background="@drawable/right"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/ImageView01"
            android:layout_alignTop="@id/ImageView01"
            />
        <ImageView
            android:id="@+id/ImageView03"
            android:background="@drawable/up"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_above="@id/ImageView01"
            android:layout_alignLeft="@id/ImageView01"
            />
        <ImageView
            android:id="@+id/ImageView04"
            android:background="@drawable/down"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/ImageView01"
            android:layout_alignLeft="@id/ImageView01"
            />
        <ImageView
            android:id="@+id/ImageView05"
            android:background="@drawable/left"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toLeftOf="@id/ImageView01"
            android:layout_alignTop="@id/ImageView01"
            />
    </RelativeLayout>

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

  • 相关阅读:
    Mego(02)
    Mego(01)
    ThoughtWorks(中国)程序员读书雷达 —— 书籍下载整理
    Spring源码编译一次性通过&遇到的坑解决方法
    Elasticsearch怎么修改索引字段类型?
    Flume 自定义拦截器 多行读取日志+截断
    用Hibernate框架把hql生成可执行的sql语句-Oracle方言
    深入浅出SQL Server中的死锁 [转于CareySon]
    第一次迭代随笔
    结对编程代码分析
  • 原文地址:https://www.cnblogs.com/newlist/p/2686846.html
Copyright © 2011-2022 走看看