gpt4 book ai didi

android - 查看隐藏在android Activity 中的其他 View 后面

转载 作者:行者123 更新时间:2023-11-30 03:13:57 25 4
gpt4 key购买 nike

我正在尝试全屏加载图像并放置两个按钮栏(一个在顶部,一个在底部)。但是当我测试应用程序时,顶部栏被完整图像隐藏,而底部栏正确显示。

enter image description here

enter image description here

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<RelativeLayout
android:id="@+id/relshare"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#60000000" >

<Button
android:id="@+id/btnBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/setaswallpaper"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/back_button"
android:gravity="right" />

<Button
android:id="@+id/setaswallpaper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/set_wallpaper"
android:gravity="right"
android:textSize="25sp" />

<Button
android:id="@+id/bshare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/setaswallpaper"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/share"
android:gravity="right" />
</RelativeLayout>

<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadingEdgeLength="10dp"
android:filterTouchesWhenObscured="true"
android:focusableInTouchMode="false"
android:scrollbarDefaultDelayBeforeFade="100000" />

<ProgressBar
android:id="@+id/pb"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />

<RelativeLayout
android:id="@+id/relshare2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#60000000" >

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:orientation="horizontal" >

<Button
android:id="@+id/bfavorite"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@drawable/favorite1"
android:gravity="left"
android:padding="10dp"
android:textSize="25sp" />

<TextView
android:layout_width="40dp"
android:layout_height="40dp" />

<Button
android:id="@+id/download"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@drawable/download"
android:gravity="right"
android:padding="10dp"
android:textSize="25sp" />
</LinearLayout>

<Button
android:id="@+id/info"
style="?android:attr/buttonStyleSmall"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_centerHorizontal="true"
android:background="@drawable/info" />

<Button
android:id="@+id/reportissue"
style="?android:attr/buttonStyleSmall"
android:layout_width="50dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:background="@drawable/report_issue"
android:text="" />
</RelativeLayout>
</RelativeLayout>

请帮我解决这个错误

最佳答案

在你的 xml 中试试这个?

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadingEdgeLength="10dp"
android:filterTouchesWhenObscured="true"
android:focusableInTouchMode="false"
android:scrollbarDefaultDelayBeforeFade="100000" />

<ProgressBar
android:id="@+id/pb"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />

<RelativeLayout
android:id="@+id/relshare"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#60000000" >

<Button
android:id="@+id/btnBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/setaswallpaper"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/back_button"
android:gravity="right" />

<Button
android:id="@+id/setaswallpaper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/set_wallpaper"
android:gravity="right"
android:textSize="25sp" />

<Button
android:id="@+id/bshare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/setaswallpaper"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/share"
android:gravity="right" />
</RelativeLayout>

<RelativeLayout
android:id="@+id/relshare2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#60000000" >

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:orientation="horizontal" >

<Button
android:id="@+id/bfavorite"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@drawable/favorite1"
android:gravity="left"
android:padding="10dp"
android:textSize="25sp" />

<TextView
android:layout_width="40dp"
android:layout_height="40dp" />

<Button
android:id="@+id/download"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@drawable/download"
android:gravity="right"
android:padding="10dp"
android:textSize="25sp" />
</LinearLayout>

<Button
android:id="@+id/info"
style="?android:attr/buttonStyleSmall"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_centerHorizontal="true"
android:background="@drawable/info" />

<Button
android:id="@+id/reportissue"
style="?android:attr/buttonStyleSmall"
android:layout_width="50dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:background="@drawable/report_issue"
android:text="" />
</RelativeLayout>
</RelativeLayout>

重新排序 XML 总是有助于解决这个问题。

关于android - 查看隐藏在android Activity 中的其他 View 后面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20464955/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com