【发布时间】:2021-01-22 16:16:06
【问题描述】:
我有一个滚动视图,但我想要一个带有 3 个按钮的线性布局,这些按钮在滚动时保持在顶部。所以它的功能应该有点像贴在顶部的导航栏。 当前代码:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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=".MainActivity">
<androidx.gridlayout.widget.GridLayout
android:id="@+id/gridRoot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:columnCount="2"
app:rowCount="32">
</androidx.gridlayout.widget.GridLayout>
</ScrollView>
【问题讨论】:
标签: android xml layout android-linearlayout android-scrollview