本文整理匯總了Java中android.widget.TextView.setInputType方法的典型用法代碼示例。如果您正苦於以下問題:Java TextView.setInputType方法的具體用法?Java TextView.setInputType怎麽用?Java TextView.setInputType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.TextView
的用法示例。
在下文中一共展示了TextView.setInputType方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: apply
import android.widget.TextView; //導入方法依賴的package包/類
@Override
public void apply(View view, String value, ViewGroup parent, Map<String, String> attrs) {
if (!(view instanceof TextView))
return;
TextView textView = (TextView) view;
String[] types = value.split("[|]");
int inputType = 0;
for (String type : types) {
if (mInputTypes.containsKey(type)) {
inputType |= mInputTypes.get(type);
}
}
if (inputType != 0)
textView.setInputType(inputType);
}
開發者ID:feifadaima,項目名稱:https-github.com-hyb1996-NoRootScriptDroid,代碼行數:16,代碼來源:ConvertLayoutInflater.java
示例2: onFinishInflate
import android.widget.TextView; //導入方法依賴的package包/類
@Override
protected void onFinishInflate() {
super.onFinishInflate();
final Context context = getContext();
textView = (TextView) getChildAt(0);
textView.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
textView.setHintTextColor(lessSignificantColor);
textView.setHorizontalFadingEdgeEnabled(true);
textView.setSingleLine();
setValidateAmount(textView instanceof EditText);
textView.addTextChangedListener(textViewListener);
textView.setOnFocusChangeListener(textViewListener);
contextButton = new View(context) {
@Override
protected void onMeasure(final int wMeasureSpec, final int hMeasureSpec) {
setMeasuredDimension(textView.getCompoundPaddingRight(), textView.getMeasuredHeight());
}
};
final LayoutParams chooseViewParams = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
chooseViewParams.gravity = Gravity.RIGHT;
contextButton.setLayoutParams(chooseViewParams);
this.addView(contextButton);
updateAppearance();
}
示例3: initView
import android.widget.TextView; //導入方法依賴的package包/類
private void initView(){
View view = mInflater.inflate(R.layout.widet_num_add_sub,this,true);
mEtxtNum = (TextView) view.findViewById(R.id.etxt_num);
mEtxtNum.setInputType(InputType.TYPE_NULL);
mEtxtNum.setKeyListener(null);
mBtnAdd = (Button) view.findViewById(R.id.btn_add);
mBtnSub = (Button) view.findViewById(R.id.btn_sub);
mBtnAdd.setOnClickListener(this);
mBtnSub.setOnClickListener(this);
}
示例4: initView
import android.widget.TextView; //導入方法依賴的package包/類
private void initView() {
View view = mInflater.inflate(R.layout.widet_num_add_sub, this, true);
mEtxtNum = (TextView) view.findViewById(R.id.etxt_num);
mEtxtNum.setInputType(InputType.TYPE_NULL);
mEtxtNum.setKeyListener(null);
mBtnAdd = (Button) view.findViewById(R.id.btn_add);
mBtnSub = (Button) view.findViewById(R.id.btn_sub);
mBtnAdd.setOnClickListener(this);
mBtnSub.setOnClickListener(this);
}
示例5: setInputType
import android.widget.TextView; //導入方法依賴的package包/類
public SuperRecyclerHolder setInputType(@IdRes int viewId, int type) {
TextView textView = retrieveView(viewId);
textView.setInputType(type);
return this;
}