Xml Android开发|如何调动我的textview?
我正在开发我的视频消息应用程序的新版本。我正在进行联系人活动,我希望在联系人之前有一个显示“联系人”(意大利语联系人)的文本视图。 我需要当我向上滚动时,我的文本视图(labelcontacts)保持不动,并且没有固定在它的位置。 此时,当您向上滚动时,textview将随着布局移动而移动 我的代码:Xml Android开发|如何调动我的textview?,xml,android-layout,textview,Xml,Android Layout,Textview,我正在开发我的视频消息应用程序的新版本。我正在进行联系人活动,我希望在联系人之前有一个显示“联系人”(意大利语联系人)的文本视图。 我需要当我向上滚动时,我的文本视图(labelcontacts)保持不动,并且没有固定在它的位置。 此时,当您向上滚动时,textview将随着布局移动而移动 我的代码: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:andr
<?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"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar_layout_contacts"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_contacts"
android:layout_width="match_parent"
android:layout_height="50dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="FtoF"
android:textSize="20sp"
android:textStyle="bold"
android:textColor="#fff"
android:layout_centerVertical="true"/>
<ImageView
android:id="@+id/find_people_btn"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentEnd="true"
android:layout_marginEnd="12dp"
android:src="@drawable/find_people"
app:tint="@android:color/white" />
</RelativeLayout>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/labelcontacts"
android:layout_width="wrap_content"
android:layout_height="@dimen/activity_vertical_margin"
android:text="Contatti"
android:layout_centerVertical="true"
android:layout_marginTop="100dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="0dp"
/>
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/contact_list"
android:layout_below="@+id/app_bar_layout_contacts"
android:layout_above="@+id/nav_view">
</androidx.recyclerview.widget.RecyclerView>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/windowBackground"
app:menu="@menu/bottom_nav_menu"
android:layout_alignParentBottom="true"/>
</RelativeLayout>