一、编写Progress文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:visibility="visible"
>
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleLarge"
/> <!--progress的样式是圆圈滚动-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/loading"
android:textColor="@color/black"
android:textSize="20dp"/>
</LinearLayout>
二、编写title_bar文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:background="@drawable/rg_bar"
>
<Button
android:id="@+id/btn_refresh"
android:layout_width="60sp"
android:layout_height="60sp"
android:background="@drawable/title_icon_refresh"
android:layout_gravity="left"
/>
<TextView
android:id="@+id/text_userId"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/userId"
android:textSize="20sp"
android:textColor="@color/black"
android:layout_gravity="center"
/>
<Button
android:id="@+id/btn_write"
android:layout_width="60sp"
android:layout_height="60sp"
android:background="@drawable/title_icon_write_n"
android:layout_gravity="right"
/>
</FrameLayout>
</LinearLayout>
三、在layout中载入两个布局
<include android:id="@+id/layout_title_bar" layout="@layout/title_bar"/>
<include android:id="@+id/layout_progress" layout="@layout/progress" />
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:visibility="visible"
>
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleLarge"
/> <!--progress的样式是圆圈滚动-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/loading"
android:textColor="@color/black"
android:textSize="20dp"/>
</LinearLayout>
二、编写title_bar文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:background="@drawable/rg_bar"
>
<Button
android:id="@+id/btn_refresh"
android:layout_width="60sp"
android:layout_height="60sp"
android:background="@drawable/title_icon_refresh"
android:layout_gravity="left"
/>
<TextView
android:id="@+id/text_userId"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/userId"
android:textSize="20sp"
android:textColor="@color/black"
android:layout_gravity="center"
/>
<Button
android:id="@+id/btn_write"
android:layout_width="60sp"
android:layout_height="60sp"
android:background="@drawable/title_icon_write_n"
android:layout_gravity="right"
/>
</FrameLayout>
</LinearLayout>
三、在layout中载入两个布局
<include android:id="@+id/layout_title_bar" layout="@layout/title_bar"/>
<include android:id="@+id/layout_progress" layout="@layout/progress" />