使用默认系统键盘并仅重新创建必要的键盘

问题描述 投票:1回答:0

我有如下创建键盘的要求:1)仅编辑文本最初可见
2)在单击“编辑文本”时,将启动一个tabwidget / Buttons / ImageView,并且窗口小部件的第一个选项卡包含默认系统键盘,其余选项卡包含自定义键盘。 3)EditText出现在键盘和tabWi的顶部,如下所述,我尝试使用SCrollView尝试使用以下XML

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true">

      <EditText
      android:id="@+id/editview"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_marginTop="15dp"
      android:ems="10"
      android:inputType="text"/>

    </ScrollView>

    <RelativeLayout
        android:id="@+id/relView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="-8dip ">
        <ImageView
            android:id="@+id/button1"
            android:src="@drawable/ic_launcher"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_marginRight="-8dip" 
            android:layout_marginLeft="-8dip" />

        <ImageView
            android:id="@+id/button2"
            android:src="@drawable/ic_launcher"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/button1"
            android:adjustViewBounds="true"
            android:layout_marginRight="-8dip" />
        <ImageView
            android:id="@+id/button3"
            android:src="@drawable/ic_launcher"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/button2"
            android:adjustViewBounds="true"
            android:layout_marginRight="-8dip" />
        <ImageView
            android:id="@+id/button4"
            android:src="@drawable/ic_launcher"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/button3"
            android:adjustViewBounds="true"
            android:layout_marginRight="-8dip" />

    </RelativeLayout>

</RelativeLayout>

这样,通过设置android:windowSoftInputMode =“ stateAlwaysHidden | adjustResize | adjustPan”,可以启动键盘并在屏幕底部显示图像视图。

但是我只想在单击ImageText和Edit Text时获得ImageView和键盘,应该在键盘顶部。

tabwidget keypad
© www.soinside.com 2019 - 2024. All rights reserved.