<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <com.example.myweek.MyTitle android:layout_width="wrap_content" android:layout_height="wrap_content"> </com.example.myweek.MyTitle> </LinearLayout> -**********************************
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/tv_title" android:text="鄙人标题,点击清空" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:id="@+id/btn_add" android:text="鄙人按钮,点击添加" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> <com.example.myweek.MyView android:id="@+id/cc" android:layout_width="match_parent" android:layout_height="wrap_content"> </com.example.myweek.MyView> </LinearLayout>