【发布时间】:2015-06-23 14:50:12
【问题描述】:
我无法设置进度条的大小。我试过这个:
style="?android:attr/progressBarStyleSmall"
还有这个:
android:maxHeight="5dp"
布局xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!-- The main content view -->
<FrameLayout
android:id="@+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</FrameLayout>
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:indeterminate="true"
style="?android:attr/progressBarStyle"
android:id="@+id/progress_bar"
android:maxHeight="5dp"
android:layout_marginRight="5dp" />
<!-- The navigation drawer list
<LinearLayout
android:id="@+id/linear_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="left"
android:layout_marginTop="10dp">
"#368ee0" -->
<ListView
android:id="@+id/slider_list"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#368ee0"
android:textColor="#ffffff"
android:choiceMode="singleChoice"
android:divider="#b0e0e6"
android:dividerHeight="1dp" />
<!--
</LinearLayout>-->
</android.support.v4.widget.DrawerLayout>
我在 MainActivity 中创建 ProgressBar,当我更新显示 (updateDisplay) 时,我创建一个新的 WebFragment 并将 progressBar 作为参数传递,WebFragment 然后运行一个线程,完成后将 progressBar 的可见性变为“走了”。
【问题讨论】:
标签: android xml android-layout android-progressbar