當前位置:首頁 » 安卓系統 » androidedittext自定義

androidedittext自定義

發布時間: 2022-09-26 18:29:54

Ⅰ android自定義edittext 當有文字時怎麼禁止長按全選事件

你給復選框設置監聽事件,當選中的時候,就給edittext.setText如:checkbox.setOnCheckedChangeListener(newCompoundButton.OnCheckedChangeListener(){@(CompoundButtonbuttonView,booleanisChecked){//TODOAuto-generatedmethodstubif(isChecked){editText1.setText("選中");}else{editText1.setText("取消選中");}}});

Ⅱ android:自定義可輸入對話框,EditText已經獲得焦點,為什麼就是不彈出輸入法呢

因為你彈出的對話框跟MainActivity(假設你是在MainActivity上他彈出的)不在同一個Activity上,所以就顯示不出來了,就算你能看到軟鍵盤你也無法輸入。

Ⅲ android 中 如何控制activity中顯示的EditText的長度 即按照自己的想法定義長度

可以使用LayoutParams來設置,editText.setLayoutParams(new LayoutParams("24","30"));

Ⅳ android 自定義的dialog,edit text 不能獲得焦點,彈出軟鍵盤。

1、首先自定義布局
2、把自定義布局放入dialog中顯示
3、通過自定義布局查找對應的edittext組件
final View DialogView = a .inflate ( R.layout.loand, null);//1、自定義布局
//創建對話框
AlertDialog dlg = new AlertDialog.Builder(loand.this)
.setTitle("登錄框")
.setView(DialogView)//設置自定義對話框的樣式,2、自定義布局放入dialog中顯示
.setPositiveButton("登陸", //設置"確定"按鈕
new DialogInterface.OnClickListener() //設置事件監聽{
public void onClick(DialogInterface dialog, int whichButton){editText1 =(EditText) DialogView.findViewById(R.id.editText1);
editText2 =(EditText) DialogView.findViewById(R.id.editText2);//3、過自定義布局查找對應的edittext組件
String id = editText1.getText().toString();
String password = editText2.getText().toString();

Ⅳ 在android 裡面怎麼自定義一個EditText,而這個EditText只能輸入數字,請大俠們指教 有源碼就更好了

定義一個edittext
<EditText
android:id="@+id/newperson"
android:singleLine="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/newperson_hint"
android:focusable="true"
android:focusableInTouchMode="true"
android:numeric="integer"
/>

android:numeric="integer",說明你只能輸入數字;

Ⅵ android自定義edittext怎麼設置背景

JAVA中這樣寫:setBackgroundDrawable(new BitmapDrawable(("bg_focus.png")));

熱點內容
計算機上輸入ftp還是htp 發布:2025-09-16 06:00:09 瀏覽:549
汽車裡面的花瓶怎麼配置 發布:2025-09-16 05:56:05 瀏覽:449
溯源碼貼 發布:2025-09-16 05:52:56 瀏覽:148
檢測信號數據存儲 發布:2025-09-16 05:21:41 瀏覽:404
androiddagger2 發布:2025-09-16 04:38:38 瀏覽:123
javahttp編程 發布:2025-09-16 04:33:44 瀏覽:303
壓縮安裝器 發布:2025-09-16 03:47:17 瀏覽:181
特產網源碼 發布:2025-09-16 03:42:24 瀏覽:331
安卓faceplay怎麼付款 發布:2025-09-16 03:32:34 瀏覽:588
安卓rom包里有什麼 發布:2025-09-16 03:07:57 瀏覽:356