我有一个问题,我无法找到任何答案。 如何制作布局滚动并制作另一个不滚动的布局? 另一方面,我想做一个布局,包括一些按钮,如果需要滚动,我想在屏幕的底部放两个按钮,我不希望它们在滚动时消失。如何滚动活动的一部分
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/background"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context="com.myname.myapp.MainActivity">
// a bunch of Buttons and TextViews
</RelativeLayout>
</scrollView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
// two Moveless Buttons
</RelativeLayout>
但它不起作用。
“不起作用”是什么意思?当你运行这个应用程序会发生什么,它与你想要的有什么不同? –
它有错误。 “多根标签” – Skillson
谷歌搜索错误消息几乎总是很好。例如,[this](http://stackoverflow.com/questions/24275533/multiple-root-tags-in-android-studio)。 –