小编Chr*_*623的帖子

警报对话框的按钮被切断

我有一个警报对话框,当有人触摸特定按钮时启动该对话框.警报对话框包含由布局xml文件定义的视图.此布局包含多个控件,如复选框,编辑文本字段,...这些控件都在一个scrool视图中,以便您可以滚动浏览内容,如果整个内容不适合屏幕.

现在的问题是,当我启动此警报对话框时,底部的按钮被切断屏幕.尽管scrool栏正在工作,我可以滚动警告对话框的内容,警报对话框的按钮有时不完全可见.

这意味着:有时,一切都很好,我可以看到警报对话框的按钮,有时候出于奇怪的原因,按钮被切断了.我认为这是一个问题,对于警报对话框来说要大,并且按下按钮更多.例如,视图包含编辑文本控件.如果我输入我的名字,一切都很好.但是如果我在这个编辑文本中添加一个新行,那么这些按钮就会被切断一点.我错了什么?我认为滚动视图将处理我的视图的超大尺寸,以便警报对话框适合屏幕.我的应用程序始终处于纵向模式.

视图的代码:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scrollView2"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="5dp" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/bitteeinstellungenwaehlen" />

        <EditText
            android:id="@+id/edtTeam1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="@string/hteam1"
            android:text="Christoph" >

            <requestFocus />
        </EditText>

        <EditText
            android:id="@+id/edtTeam2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="@string/hteam2"
            android:text="Lea" />

        <EditText
            android:id="@+id/edtTeam3"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="@string/hteam3"
            android:text="Ludwig" />

        <EditText
            android:id="@+id/edtTeam4"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="@string/hteam4"
            android:text="Anja" />

        <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/weitereeinstellungen" />

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

            <CheckBox
                android:id="@+id/chkModerationMode"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/moderationsmodus" />

            <TextView
                android:id="@+id/textView3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:text="@string/info" …
Run Code Online (Sandbox Code Playgroud)

java android android-alertdialog

10
推荐指数
1
解决办法
2446
查看次数

标签 统计

android ×1

android-alertdialog ×1

java ×1