我有一個問題,我無法找到任何答案。 如何製作佈局滾動並製作另一個不滾動的佈局? 另一方面,我想做一個佈局,包括一些按鈕,如果需要滾動,我想在屏幕的底部放兩個按鈕,我不希望它們在滾動時消失。如何滾動活動的一部分
<?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)。 –