Scrollview sotto l'intestazione

0

Domanda

C'è un modo per fare questo in android studio? Voglio ottenere che quando si scorrere verso il basso l'intestazione sovrapposizione di sopra e al di sotto è la scrollview parte. Quello che ho ottenuto è che scorre sopra l'intestazione. In android studio

Questo è ciò che Im cercando di ottenere che è stato fatto in figma

Di Default

Quando si scorre

Finora questo è ciò che il mio codice simile

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context=".Fragment.RecordFragment"
    android:orientation="vertical">

    <View
        android:layout_width="369dp"
        android:layout_height="71dp"
        android:layout_alignParentLeft="true"
        android:layout_marginLeft="13dp"
        android:layout_alignParentTop="true"
        android:layout_marginTop="14dp"
        android:background="@drawable/ic_header"/>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_marginStart="25dp"
        android:layout_marginTop="25dp"
        android:layout_marginEnd="25dp"
        android:layout_marginBottom="25dp"
        android:text="Record"
        android:textAlignment="center"
        android:textColor="@color/white"
        android:textSize="35sp" />


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

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:orientation="vertical"
            android:paddingBottom="100dp">

            <TextView
                android:id="@+id/txtDate"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_marginTop="128dp"
                android:text="Date for today"
                android:textAlignment="center"
                android:textColor="@color/black"
                android:textSize="50sp" />

            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">

                <View
                    android:layout_width="316dp"
                    android:layout_height="201dp"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentTop="true"
                    android:layout_gravity="center"
                    android:layout_marginTop="50dp"
                    android:background="@drawable/sec_bp" />

                <EditText
                    android:layout_width="250dp"
                    android:layout_height="30dp"
                    android:layout_marginLeft="30dp"
                    android:layout_marginTop="70dp"
                    android:background="@drawable/rounded_corner"
                    android:gravity="center"
                    android:hint="SBP" />

                <EditText
                    android:layout_width="250dp"
                    android:layout_height="30dp"
                    android:layout_marginLeft="30dp"
                    android:layout_marginTop="120dp"
                    android:background="@drawable/rounded_corner"
                    android:gravity="center"
                    android:hint="DBP" />

                <EditText
                    android:layout_width="250dp"
                    android:layout_height="30dp"
                    android:layout_marginLeft="30dp"
                    android:layout_marginTop="170dp"
                    android:background="@drawable/rounded_corner"
                    android:gravity="center"
                    android:hint="BPM" />

                <Button
                    android:layout_width="70dp"
                    android:layout_height="30dp"
                    android:layout_marginLeft="120dp"
                    android:layout_marginTop="210dp"
                    android:background="@drawable/rounded_corner"
                    android:gravity="center"
                    android:text="save" />

            </RelativeLayout>

            <View
                android:layout_width="316dp"
                android:layout_height="117dp"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true"
                android:layout_marginTop="50dp"
                android:background="@drawable/sec_temp" />

            <View
                android:layout_width="316dp"
                android:layout_height="117dp"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true"
                android:layout_marginTop="50dp"
                android:background="@drawable/sec_temp" />


        </LinearLayout>

    </ScrollView>

</RelativeLayout>
android android-studio
2021-11-24 02:52:12
1

Migliore risposta

0

Prova ad aggiungere elevazione all'interno dell'intestazione vista. come questa :

<View
    android:layout_width="369dp"
    android:layout_height="71dp"
    android:layout_alignParentLeft="true"
    android:layout_marginLeft="13dp"
    android:layout_alignParentTop="true"
    android:layout_marginTop="14dp"
    android:background="@drawable/ic_header"/
    android:elevation="1dp">

<TextView
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:layout_marginStart="25dp"
    android:layout_marginTop="25dp"
    android:layout_marginEnd="25dp"
    android:layout_marginBottom="25dp"
    android:text="Record"
    android:textAlignment="center"
    android:textColor="@color/white"
    android:textSize="35sp" 
    android:elevation="2dp"/>

Ho impostato la Visualizzazione di elevazione 1dp e la TextView 2dp, in modo che il testo può ancora davanti alla Vista.

2021-11-24 04:11:22

In altre lingue

Questa pagina è in altre lingue

Русский
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................