gpt4 book ai didi

android - android中工具栏下方的 ScrollView

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:59:00 25 4
gpt4 key购买 nike

是否可以在 Android 中的工具栏下方设置滚动条?我正在试用 scrollbarView 我有一个工具栏附加到我的布局是这样的:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/layoutcolor_background"
android:orientation="vertical"
tools:ignore="ContentDescription,RtlHardcoded,NestedWeights">

<include
android:id="@+id/toolbar"
layout="@layout/main_toolbar" />

<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="@drawable/toolbar_dropshadow" />

<LinearLayout
android:id="@+id/aandcID"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_weight=".50"
android:baselineAligned="false"
android:orientation="horizontal">

<RelativeLayout
android:id="@+id/alayout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight=".50"
android:background="@color/layoutbackgroudforrow"
android:gravity="center">

<ImageView
android:id="@+id/aimage"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:paddingBottom="3dp"
android:paddingTop="5dp"
android:src="@drawable/acc" />

<TextView
android:id="@+id/aType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/aimage"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:gravity="center"
android:paddingLeft="2dp"
android:singleLine="true"
android:text="Deposit"
android:textColor="@color/blackText"
android:textSize="18sp"
android:textStyle="bold"
tools:ignore="RtlSymmetry,RtlHardcoded,HardcodedText" />

<TextView
android:id="@+id/anumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/aType"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:gravity="center"
android:paddingLeft="2dp"
android:singleLine="true"
android:text="12345678901234567890"
android:textColor="@color/blackText"
android:textSize="18sp"
tools:ignore="RtlSymmetry,RtlHardcoded,HardcodedText" />

<ImageView
android:id="@+id/rupeeIcon"
android:layout_width="12dp"
android:layout_height="14dp"
android:layout_below="@+id/anumber"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:layout_toLeftOf="@+id/accatext"
android:background="@drawable/rupees_symbol"
android:paddingBottom="2dp"
android:visibility="visible"
tools:ignore="ContentDescription" />

<TextView
android:id="@+id/accatext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/anumber"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:gravity="center"
android:paddingLeft="2dp"
android:singleLine="true"
android:text="09876543210987654321"
android:textColor="@color/numbertext"
android:textSize="16sp"
tools:ignore="RtlSymmetry,RtlHardcoded,HardcodedText" />
</RelativeLayout>
</LinearLayout>

<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/footer_band" />

</LinearLayout>
</ScrollView>

使用上面的代码.. 工具栏也会滚动,因此它也会被剪切。有没有办法卡住工具栏,然后滚动其他 View 。

如果有人能指导我,那该多好?

谢谢!

最佳答案

就做这样的事

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<include layout="@layout/toolbar" />

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<!-- Rest of your content -->

</LinearLayout>

</ScrollView>

</LinearLayout>

关于android - android中工具栏下方的 ScrollView ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32636602/

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