滚动视图以显示自定义对话框

时间:2014-12-09 11:50:36

标签: android

我一直在尝试为自定义对话框添加scrollview,但它不会滚动。我在这个网站上尝试了所有建议的答案,但无法成功。我在这里发布了我的layout.xml文件。请帮帮我。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">

<ScrollView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@color/New_Cust_Popup_Background"
    android:fadeScrollbars="false"
    android:fillViewport="true"
    tools:ignore="ScrollViewSize,InefficientWeight,RtlHardcoded,UselessParent" >

<RelativeLayout
    android:id="@+id/pop_element"
    android:layout_width="match_parent"
    android:layout_height="373dp"
    android:background="@drawable/blackframe_edttxt"
    android:orientation="vertical"
    android:scrollbarAlwaysDrawVerticalTrack="true" >

        <AutoCompleteTextView
            android:id="@+id/AutoCmpltTxtViewCountry"
            style="@style/Custom_newCust_popup_edit_style"
            android:layout_height="30dp"
            android:layout_below="@+id/AutoCmpltTxtViewState"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="16dp"
            android:ems="10"
            android:hint="@string/new_cust_popup_Country" />

        <EditText
            android:id="@+id/EdtAddress"
            style="@style/Custom_newCust_popup_edit_style"
            android:layout_height="100dp"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:ems="10"
            android:gravity="top"
            android:hint="@string/new_cust_popup_Address"
            android:inputType="textPostalAddress"
            tools:ignore="HardcodedText" />

        <AutoCompleteTextView
            android:id="@+id/AutoCmpltTxtViewCity"
            style="@style/Custom_newCust_popup_edit_style"
            android:layout_height="30dp"
            android:layout_below="@+id/EdtAddress"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="16dp"
            android:ems="10"
            android:hint="@string/new_cust_popup_City" />

        <AutoCompleteTextView
            android:id="@+id/AutoCmpltTxtViewState"
            style="@style/Custom_newCust_popup_edit_style"
            android:layout_height="30dp"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/AutoCmpltTxtViewCity"
            android:layout_marginTop="16dp"
            android:ems="10"
            android:hint="@string/new_cust_popup_State" />

        <EditText
            android:id="@+id/EdtPostalCode"
            style="@style/Custom_newCust_popup_edit_style"
            android:layout_height="30dp"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/AutoCmpltTxtViewCountry"
            android:layout_marginTop="16dp"
            android:ems="10"
            android:gravity="top"
            android:hint="@string/new_cust_popup_Postal_Code"
            android:inputType="textPostalAddress"
            tools:ignore="HardcodedText" />

        <Button
            android:id="@+id/BtnClosePopup"
            style="@style/Custom_newCust_popup_button_style"
            android:layout_alignBottom="@+id/BtnPopUpSave"
            android:layout_alignParentBottom="true"
            android:layout_alignRight="@+id/EdtPostalCode"
            android:layout_alignTop="@+id/BtnPopUpSave"
            android:layout_marginRight="56dp"
            android:text="@string/new_cust_popup_Cancel"
            tools:ignore="ButtonOrder,HardcodedText,RtlHardcoded" />

        <Button
            android:id="@+id/BtnPopUpSave"
            style="@style/Custom_newCust_popup_button_style"
            android:layout_alignParentBottom="true"
            android:layout_marginRight="41dp"
            android:layout_toLeftOf="@+id/BtnClosePopup"
            android:text="@string/new_cust_popup_Save"
            tools:ignore="HardcodedText,RtlHardcoded" />

</RelativeLayout>

</ScrollView>
</LinearLayout>

`

0 个答案:

没有答案
相关问题