私はImageViewをイメージの背景とし、同時にプリローダーを画面の中央に縦横に並べます。私はprogressBarを中心に置くことができましたが、マージンを使ってわずかに上にオフセットすることはできませんでした。RelativeLayoutを使用して、中央揃えのProgressBarビューをオフセットしますか?
一部の人々は...私が背景となりrelativeLayoutとしての私のイメージを適用する必要があるとして、しかし、それは私のために動作しません、android:layout_weight
を使用してと制御のLinearLayout を使用することが提案
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="#FE6869"
android:weightSum="1">
<ImageView
android:src="@drawable/splashscreen"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ProgressBar
android:id="@+id/loading_spinner"
style="@style/Widget.AppCompat.ProgressBar"
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="170dp" />
</RelativeLayout >
何をしますか? –
プログレスバーを水平方向に中央と垂直の両方に揃えたいが、プログレスバーをセンターに対してわずかに上/下に配置できるようにしたい。 –