Sha*_*mad 6 android relativelayout android-progressbar
我在相对布局中包含了一个进度条,但是它在布局后面运行。有什么办法可以使它显示在页面加载时显示的前面。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="wrap_content"
android:layout_gravity="center"
android:background="@color/pageBackgroundColor"
android:gravity="center"
tools:context="co.sd.app.CheckoutActivity">
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:visibility="visible" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/relativeLayout"
android:layout_marginLeft="@dimen/page_marging_left"
android:layout_marginRight="@dimen/page_marging_right">
<android.support.v7.widget.AppCompatTextView
android:id="@+id/service_detail_cv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/shedule_apt_cv"
android:layout_marginBottom="@dimen/dim_10sp"
android:layout_marginTop="@dimen/dim_10sp"
android:textColor="@color/darkGrey" />
</RelativeLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
我不知道为什么会这样显示。
使用此代码:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="wrap_content"
android:layout_gravity="center"
android:background="@color/pageBackgroundColor"
android:gravity="center"
tools:context="co.sd.app.CheckoutActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/relativeLayout"
android:layout_marginLeft="@dimen/page_marging_left"
android:layout_marginRight="@dimen/page_marging_right">
<android.support.v7.widget.AppCompatTextView
android:id="@+id/service_detail_cv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/shedule_apt_cv"
android:layout_marginBottom="@dimen/dim_10sp"
android:layout_marginTop="@dimen/dim_10sp"
android:textColor="@color/darkGrey" />
</RelativeLayout>
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:visibility="visible" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
希望这对您有所帮助。
| 归档时间: |
|
| 查看次数: |
5036 次 |
| 最近记录: |