我想制作一个自定义键盘.我不知道如何在xml和activity中做到这一点.这张照片是我的键盘型号.它只需要数字.

我有一个简单EditText的ListView定义如下.
应用程序运行时,会选择EditText并显示键盘.
我不希望这种情况发生.我不希望它被选中或默认情况下出现键盘.
<EditText
android:id="@+id/search_box"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="type to search titles"
android:inputType="text"
android:maxLines="1"
android:capitalize="none"
android:linksClickable="false"
android:autoLink="none"
android:autoText="true"
android:singleLine="true" />
<ListView
android:id="@+id/DetailsListView"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:background="@color/transparent"
android:cacheColorHint="@color/transparent"
android:listSelector="@drawable/list_selector"
android:fastScrollEnabled="true" />
Run Code Online (Sandbox Code Playgroud) 我有以下问题,我需要完全禁用本机键盘.键盘只应在我调用show()时显示,并在我调用close()函数时隐藏(这将在用户切换键盘的Button上).单击Field和on Focus时显示的键盘需要完全禁用.
在Stackoverflow上我发现了这个:InputMethodManager im =(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); im.hideSoftInputFromWindow(editText.getWindowToken(),0);
所以我的想法是在"Init"(IonicKeyboard.java中的第52行)我需要改变它.
if ("init".equals(action)) {
cordova.getThreadPool().execute(new Runnable() {
public void run() {
//new Logic on init
View v = cordova.getActivity().getCurrentFocus();
((InputMethodManager) cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(v.getWindowToken(), 0);
DisplayMetrics dm = new DisplayMetrics();
cordova.getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);
final float density = dm.density;
//http://stackoverflow.com/a/4737265/1091751 detect if keyboard is showing
final View rootView = cordova.getActivity().getWindow().getDecorView().findViewById(android.R.id.content).getRootView();
OnGlobalLayoutListener list = new OnGlobalLayoutListener() {
int previousHeightDiff = 0;
@Override
public void onGlobalLayout() {
Rect r = new Rect();
//r will be populated with the coordinates of your view …Run Code Online (Sandbox Code Playgroud)