When I`m use the scroll, the views not displayed

30 Views Asked by At

When I use a scroll, the views that appear in the tag Percentage library are not displayed. This problem occurs when I run the program on the device emulator and when the program is executed, the Activity is blank from each view.

<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="ir.ac.mjdkh.myclass.SignIn"
android:layoutDirection="rtl"
android:background="@color/Main">
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <android.support.percent.PercentRelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/Main">
        <ImageView
            android:id="@+id/imgPass"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:contentDescription="@string/todo"
            android:overScrollMode="always"
            android:src="@drawable/img_password"
            app:layout_heightPercent="40%"
            app:layout_marginTopPercent="4%"
            app:layout_widthPercent="90%" />
        <EditText
            android:id="@+id/txtPass"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_gravity="center_horizontal"
            android:background="@drawable/shape_txt_pass"
            android:gravity="center"
            android:hint="@string/hint_Pass"
            android:inputType="numberPassword"
            android:maxLength="8"
            app:layout_heightPercent="6%"
            app:layout_marginTopPercent="55%"
            app:layout_widthPercent="80%" />
        <Button
            android:id="@+id/btnLogin"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_centerHorizontal="true"
            android:background="@drawable/shape_btn_login"
            android:text="@string/txt_btnLogin"
            android:textAlignment="center"
            android:textColor="@color/Main"
            android:textIsSelectable="false"
            android:textSize="10pt"
            app:layout_heightPercent="10%"
            app:layout_marginTopPercent="75%"
            app:layout_widthPercent="50%" />
    </android.support.percent.PercentRelativeLayout>
</ScrollView>
</RelativeLayout>

This is My Activity & View

enter image description here

Empty activity after running the program

enter image description here

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sign_in);
}
0

There are 0 best solutions below