0
我的代碼目前看起來像這樣進度不在中間
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ProgressBar
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:id="@+id/progressBar" />
<WebView
android:layout_width="match_parent"
android:layout_height="518dp"
android:id="@+id/webview" />
</LinearLayout>
我的進度僅在水平方向,而不是垂直居中。
我能得到它以兩種方式使用此代碼
<ProgressBar
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_gravity="center"
android:id="@+id/progressBar" />
但中心則進度條(或相當紡)是大,因爲它可以得到,使其覆蓋整個屏幕。
任何解決方案,這樣我可以得到它在正常的高度和寬度爲中心。
使用RelativeLayout – Rohit5k2