android - 在android中启动应用程序后无法看到整个页面

标签 android android-layout android-activity android-fragments

当我尝试启动可能的应用程序时,我无法看到整个页面。我添加了#button。但只有两个按钮可见。如何使其与 Emulator 兼容,以便我可以看到其中的任何内容页面。

代码如下:

这是我的 Xml 文件

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.button.ButtonActivity$PlaceholderFragment" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:text="This area is for you to administer the mulitple persons for which you are maintaining records." />



      <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/textView1"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="52dp"
            android:text="Add a new Person" />

        <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/textView1"
            android:layout_below="@+id/button1"
            android:layout_marginTop="22dp"
            android:text="Current Person" />

        <Button
            android:id="@+id/button3"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/button2"
            android:layout_below="@+id/button2"
            android:layout_marginTop="27dp"
            android:text="Switch To Person" />

        <Button
            android:id="@+id/button2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/textView2"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="27dp"
            android:text="Rename Person" />

        <Button
            android:id="@+id/button4"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/button3"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="27dp"
            android:text="Delete This Person" />

    </RelativeLayout>

ManifestFile

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.button"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.button.ButtonActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

请提出一些建议..

最佳答案

尝试这种方式,希望这能帮助您解决问题。

<ScrollView  xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.button.ButtonActivity$PlaceholderFragment">

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

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:text="This area is for you to administer the mulitple persons for which you are maintaining records." />



        <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/textView1"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="52dp"
            android:text="Add a new Person" />

        <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/textView1"
            android:layout_below="@+id/button1"
            android:layout_marginTop="22dp"
            android:text="Current Person" />

        <Button
            android:id="@+id/button3"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/button2"
            android:layout_below="@+id/button2"
            android:layout_marginTop="27dp"
            android:text="Switch To Person" />

        <Button
            android:id="@+id/button2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/textView2"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="27dp"
            android:text="Rename Person" />

        <Button
            android:id="@+id/button4"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/button3"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="27dp"
            android:text="Delete This Person" />

    </RelativeLayout>
</ScrollView>

关于android - 在android中启动应用程序后无法看到整个页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24379265/

相关文章:

android - Android 中的阴影到线性布局

Android:窗口类型 2038 的权限被拒绝

Android访问服务里面的activity方法

java - Android Activity生命周期: when to save the Logcat into a file?

java - 当我尝试在 Activity 的 onCreate() 方法中设置不同的内容 View 时,为什么会出现此 RuntimeException?

Android - 对 FragmentActivity 的 fragment 的 Intent Activity

android - 添加 2 年重复事件

Android BLE BluetoothGatt.writeDescriptor() 有时返回 false

android - Google 是否更改了应用内结算测试设置

android - 以编程方式将进度条放在屏幕的中心