gpt4 book ai didi

android - 在向上滚动时显示画廊

转载 作者:行者123 更新时间:2023-11-30 00:07:50 25 4
gpt4 key购买 nike

我想要的是,当我向上滚动 ScrollView 时,画廊应该打开,当我向下滚动时,表面 View (相机)应该像 OLX 一样可见。我已经在图片中解释了我的要求。希望我能以适当的方式解释我的问题。

我已经在这张图片中解释了我的要求

enter image description here

我也贴出我的xml代码让你正确理解。

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.ali.ansofexperts.Question_Photo">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/camera_preview">

</FrameLayout>
<ScrollView
android:layout_width="fill_parent"
android:id="@+id/scrollView"
android:fillViewport="true"
android:layout_height="fill_parent"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:layout_width="fill_parent"
android:minHeight="400dp"
android:layout_height="wrap_content"
android:id="@+id/click"
android:orientation="horizontal">

</LinearLayout>

<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:columnWidth="90dp"
android:numColumns="auto_fit" android:verticalSpacing="10dp"
android:horizontalSpacing="10dp" android:stretchMode="columnWidth"
android:gravity="center" android:layout_gravity="bottom"
android:layout_marginTop="400dp"></GridView>
</RelativeLayout>
</ScrollView>
</RelativeLayout>

最佳答案

我正在为初学者发布这个引用

https://android-arsenal.com/details/1/5987

此引用资料对我的问题有完整的解决方案,希望对您有所帮助。

关于android - 在向上滚动时显示画廊,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48666262/

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