如何将进度条组件放在布局的顶部?

时间:2013-08-17 02:43:30

标签: android

现在,它在垂直线的中间显示进度条 我希望它在屏幕顶部(在webview上方)

我尝试切换进度条部分和webview,但它使进度条不可见 如何在布局上显示进度条?

如果可能的话,如何更改进度条的高度以使其看起来更厚?

谢谢!

我当前的代码

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
    tools:context=".MainActivity" >




    <WebView
        android:id="@+id/webView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true" />

    <FrameLayout
    android:id="@+id/ProgressBarWrapper01"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:visibility="gone"
    android:paddingLeft="1dip"
    android:paddingRight="1dip">

        <ProgressBar
            android:id="@+id/ProgressBar01"
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">
        </ProgressBar>
    </FrameLayout>

<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"/>

</RelativeLayout>

1 个答案:

答案 0 :(得分:1)

Q1:从FrameLayout中删除 android:layout_centerInParent =“true”
Q2:您可以将 android:layout_height =“5dip”等值设置为ProgressBar。