android 04 AbsoluteLayout

绝对布局:layout_x,layout_y:坐标精准定位

xml文件:不推荐使用

<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" 
        android:layout_x="100dp"
        android:layout_y="200dp"/>

</AbsoluteLayout>

 java文件:

package com.sxt.day02_03;

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

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {//MainActivity对象创建的时候,显示布局以后这个方法调用了,
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);//显示当前布局activity_main.xml
        Log.i("tag","Hello android");//日志窗口输出
        Log.i("tag","Hello Java");
        Log.e();
        Log.d();
        Log.i("tag","android");
        
    }

}
原文地址:https://www.cnblogs.com/yaowen/p/4881220.html