Я пытаюсь поместить мой ProgressBar на столе TableLayout.ProgressBar ontop of TableLayout
Код:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:baselineAligned="false"
android:orientation="vertical" >
<ProgressBar
android:id="@+id/bar_Update"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="250dp"
android:visibility="visible" />
<ScrollView
android:id="@+id/ScrollView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableLayout
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:shrinkColumns="*"
android:stretchColumns="*"
android:gravity="center_horizontal"
android:layout_gravity="top">
<TableRow
android:id="@+id/RowTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/Title"
android:layout_width="fill_parent"
android:layout_height="60px"
android:gravity="center"
android:text="Unterichtsausfall: \n"
android:textSize="20dp"
android:textStyle="bold"
android:typeface="serif" >
</TextView>
<ImageView
android:id="@+id/imgUpdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="false"
android:baselineAlignBottom="false"
android:clickable="true"
android:src="@drawable/refresh" />
</TableRow>
</TableLayout>
</ScrollView>
</LinearLayout>
Im используя setVisibility(View.VISIBLE)
в моем коде, чтобы показать ProgressBar на вершине макета, но он не работает. Чтобы отобразить его, я использую setVisibility(View.INVISIBLE)
. Что я делаю не так? Моя цель - получить данные из Интернета. В это время появляется Спиннер. Как только данные будут извлечены, он будет отображаться в таблице, а Spinner исчезнет.
Спасибо!
Возможно, вы не должны определять прописку для всего направления. Эта ссылка о видимости android может помочь вам: http://developer.android.com/reference/android/view/View.html#attr_android:visibility –