阅读背景:

Android_自定义view设置控件位置

来源:互联网 

一:布局

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="https://schemas.android.com/apk/res/android"
    xmlns:app="https://schemas.android.com/apk/res-auto"
    xmlns:tools="https://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="activity.example.com.baikaijun20171104.FlowActivity">
    
    <activity.example.com.baikaijun20171104.view.MyView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <TextView
            android:background="#619EA0"
            android:layout_width="120dp"
            android:layout_height="50dp" />
        <TextView
            android:background="#7561A0"
            android:layout_width="120dp"
            android:layout_height="50dp" />
        <TextView
            android:background="#9FA061"
            android:layout_width="120dp"
            android:layout_height="50dp" />
    </activity.example.com.baikaijun20171104.view.MyView>

</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: