我正在进行屏幕布局,但我遇到了问题。
它有一个工具栏(设置为操作栏),滚动窗格和底部的按钮栏,它固定在屏幕底部,始终可见。
由于某些原因,即使我滚动到屏幕底部,按钮栏和按钮也不可见,但没有任何迹象。
下面是我的XML布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
android:layout_width="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/toolbar" />
<ScrollView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText android:id="@+id/db_txtConnectionName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Database Connection Name"
android:singleLine="true"
android:inputType="textNoSuggestions" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText android:id="@+id/db_txtServer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Server"
android:singleLine="true"
android:inputType="textNoSuggestions" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText android:id="@+id/db_txtUsername"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Username"
android:singleLine="true"
android:inputType="textNoSuggestions" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText android:id="@+id/db_txtPassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:singleLine="true"
android:inputType="textPassword" />
</android.support.design.widget.TextInputLayout>
<EditText android:id="@+id/db_txtDatabase"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Database"
android:singleLine="true"
android:inputType="textNoSuggestions" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText android:id="@+id/db_txtPort"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLength="6"
android:hint="Port"
android:text="3306"
android:singleLine="true"
android:inputType="number"/>
</android.support.design.widget.TextInputLayout>
<CheckBox android:id="@+id/db_chkStorePassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/store_password"
android:checked="true" />
<CheckBox android:id="@+id/db_chkConnectViaSSHTunnel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Connect via SSH Tunnel"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="SSH Connection Settings" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText android:id="@+id/db_txtSSHHost"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="SSH Host"
android:singleLine="true"
android:inputType="textNoSuggestions"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText android:id="@+id/db_txtSSHUsername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="SSH Username"
android:singleLine="true"
android:inputType="textNoSuggestions"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText android:id="@+id/db_txtSSHPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="SSH Password"
android:singleLine="true"
android:inputType="textPassword"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText android:id="@+id/db_txtSSHPort"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="SSH Port"
android:text="22"
android:singleLine="true"
android:inputType="number"/>
</android.support.design.widget.TextInputLayout>
<TextView
android:layout_marginTop="10dp"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_gravity="center_horizontal"
android:text="Leave database blank to connect to any database on this server" />
</LinearLayout>
</ScrollView>
<LinearLayout android:id="@+id/buttonContainer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
style="?android:attr/buttonBarStyle"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom">
<Button android:id="@+id/db_btnTest"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Test Connection" />
<Button android:id="@+id/db_btnCreateEdit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Create"
android:enabled="false" />
</LinearLayout>
<com.google.android.gms.ads.AdView android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
ads:adSize="BANNER"/>
</LinearLayout>
</RelativeLayout>