我有一个gridview包含活动和下面的edittexts有一个自定义键盘,你可以在下面的代码中看到我添加了按钮来输入数字。但问题是,当我点击gridview中的edittext时,软键盘弹出。隐藏软键盘问题
我试着把android:windowSoftInputMode="stateHidden"
放在清单文件中,但它甚至没有隐藏我的情况下的软键盘。我提到很多源码,包括stackoverflow,甚至没有留下任何一篇文章。我认为我的main.xml文件存在问题。我们不能把它隐藏在gridview的child里面(我知道这看起来很愚蠢,但这是我在尝试了很多事情之后所得到的最终怀疑)。有人可以建议我去哪里错了吗?如果你用你的答案测试下面的代码,然后建议我它是否有效,将不胜感激。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/fLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="2"
android:background="@drawable/background3">
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnWidth="18dp"
android:numColumns="6"
android:verticalSpacing="0dp"
android:horizontalSpacing="1dp"
android:stretchMode="columnWidth"
android:gravity="center"
android:listSelector="@null"/>
</FrameLayout>
<FrameLayout
android:id="@+id/fLayout2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="4"
android:background="@drawable/background2">
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keypad"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="*">
<TableRow>
<Button android:id="@+id/keypad_1"
android:text="1"
android:background="@drawable/custombutton">
</Button>
<Button android:id="@+id/keypad_2"
android:text="2"
android:background="@drawable/custombutton">
</Button>
<Button android:id="@+id/keypad_3"
android:text="3"
android:background="@drawable/custombutton">
</Button>
<Button android:id="@+id/keypad_4"
android:text="4"
android:background="@drawable/custombutton">
</Button>
<Button android:id="@+id/keypad_5"
android:text="5"
android:background="@drawable/custombutton">
</Button>
</TableRow>
<TableRow>
<Button android:id="@+id/keypad_6"
android:text="6"
android:background="@drawable/custombutton">
</Button>
<Button android:id="@+id/keypad_7"
android:text="7"
android:background="@drawable/custombutton">
</Button>
<Button android:id="@+id/keypad_8"
android:text="8"
android:background="@drawable/custombutton">
</Button>
<Button android:id="@+id/keypad_9"
android:text="9"
android:background="@drawable/custombutton">
</Button>
<Button android:id="@+id/keypad_10"
android:text="C"
android:background="@drawable/custombutton">
</Button>
</TableRow>
<TableRow>
<Button android:id="@+id/submit"
android:text="submit"
android:layout_span="5"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/custombutton">
</Button>
</TableRow>
</TableLayout>
</FrameLayout>
</LinearLayout>
@Shrikant你可以检查我的问题,如果给定的解决方案甚至不提供我的问题提示,我怎么可以接受答案。我不 – Kanth
如果你没有得到你的问题的正确答案,然后检查你是否很好地解释了问题。我相信你可能已经阅读过,但我仍然建议你在发布本网站上的问题之前总是阅读常见问题解答。 – Shrikant
这似乎是对我的一个论据。如果你现在可以问我,我会很高兴,如果你对我的问题有任何疑问。这个问题也不例外。当然,我总是表示感谢,因为至少他们正试图帮助解决我的问题。 – Kanth