当我使用滚动时,视图不显示

时间:2018-04-09 16:12:39

标签: android android-percentrelativelayout

当我使用滚动时,不会显示标记Percentage库中显示的视图。 当我在设备模拟器上运行程序时,当程序执行时,每个视图的活动都是空白的。

 <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="OrderUp.css">
<title>Results</title>
</head>
 <body>
 <h2> Your Form Has Been Submitted </h2>

 <script type="text/javascript">
 function results() {
 var name = document.getElementbyId('name').value;
 document.write(name);
 }
 </script>

 </body>
 </html>

这是我的活动&amp;图

enter image description here

运行程序后的空活动

enter image description here

<?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>

0 个答案:

没有答案