2
我在grid_progress_layout中看不到我的textview tv_progress_status,只能看到是我的进度条...所以我无法显示我的进度更新。如果我削减我的Textview代码并将其粘贴到进度条上方,则textview将显示并且进度条不会显示。同一布局内的其他布局的可见性无法正常工作?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/Rl_imageframe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="@drawable/imageframe"
android:paddingBottom="5dp" >
<TextView
android:id="@+id/tv_header"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_margin="4dp"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="10sp" />
<ImageView
android:id="@+id/iv_cover_page"
android:layout_width="90dp"
android:layout_height="120dp"
android:layout_below="@+id/tv_header"
android:layout_centerHorizontal="true"
android:contentDescription="@string/cover_page" />
<ImageView
android:id="@+id/iv_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/close_btn"
android:contentDescription="@string/cover_page"
android:visibility="invisible" />
<Button
android:id="@+id/b_footer"
android:layout_width="fill_parent"
android:layout_height="15dp"
android:layout_below="@+id/iv_cover_page"
android:layout_margin="4dp"
android:background="@drawable/issue_selector_red"
android:textColor="@android:color/white"
android:textSize="9sp" />
<RelativeLayout
android:id="@+id/grid_progress_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true" >
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="15dp"
android:layout_centerInParent="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:max="100"
android:progressDrawable="@drawable/progressbarlayout" />
<TextView
android:id="@+id/tv_progress_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@android:color/transparent"
android:text="100"
android:textColor="@android:color/white" />
</RelativeLayout>
</RelativeLayout>
尝试增加机器人:layout_below = “@ ID/progressBar1” 为TextView的tv_progress_status –
可能是因为两者都有android:layout_centerInParent =“true”。根据进度条尝试给文本视图提供相对位置。 – kumar
我尝试了两个,但结果相同 – Anilkumar