相关疑难解决方法(0)

Android EditText扩展为对话框

我有这个布局

在此输入图像描述

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <LinearLayout 
        android:id="@+id/viewer_top"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/background_dark"
        android:orientation="horizontal" >

        <RelativeLayout 
            android:layout_width="0dp"
            android:layout_height="wrap_content" 
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp"
            android:layout_marginTop="5dp"
            android:layout_marginBottom="3dp"
            android:layout_weight="1" >
            <EditText
                android:id="@+id/viewer_filter"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/hint_filter"
                android:background="@android:color/white"
                android:drawableLeft="@android:drawable/ic_menu_search"
                android:inputType="text"
                android:paddingLeft="4dp"
                android:selectAllOnFocus="true" >
            </EditText>
            <ImageView
                android:id="@+id/viewer_filterX"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:layout_alignTop="@id/viewer_filter"
                android:layout_alignRight="@id/viewer_filter"
                android:src="@android:drawable/ic_menu_close_clear_cancel"
                android:visibility="invisible" >
            </ImageView>
        </RelativeLayout>

        <RelativeLayout 
            android:layout_width="0dp"
            android:layout_height="wrap_content" 
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp"
            android:layout_marginTop="3dp"
            android:layout_marginBottom="5dp"
            android:layout_weight="1" >
            <EditText
                android:id="@+id/viewer_search"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/hint_search"
                android:background="@android:color/white"
                android:drawableLeft="@android:drawable/ic_menu_search"
                android:inputType="text"
                android:paddingLeft="4dp"
                android:selectAllOnFocus="true" >
            </EditText>
            <ImageView
                android:id="@+id/viewer_searchGo"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:layout_alignTop="@id/viewer_search"
                android:layout_alignRight="@id/viewer_search"
                android:src="@android:drawable/ic_menu_send"
                android:visibility="invisible" >
            </ImageView> …
Run Code Online (Sandbox Code Playgroud)

expand android landscape android-edittext

4
推荐指数
1
解决办法
1540
查看次数

标签 统计

android ×1

android-edittext ×1

expand ×1

landscape ×1