本文整理匯總了Java中android.widget.EditText.setCompoundDrawablesWithIntrinsicBounds方法的典型用法代碼示例。如果您正苦於以下問題:Java EditText.setCompoundDrawablesWithIntrinsicBounds方法的具體用法?Java EditText.setCompoundDrawablesWithIntrinsicBounds怎麽用?Java EditText.setCompoundDrawablesWithIntrinsicBounds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.EditText
的用法示例。
在下文中一共展示了EditText.setCompoundDrawablesWithIntrinsicBounds方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreateView
import android.widget.EditText; //導入方法依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment, null);
mEdit = (EditText) view.findViewById(R.id.edit);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
mEdit.setCompoundDrawablesRelativeWithIntrinsicBounds(R.drawable.drawable_left_selector,
R.drawable.drawable_top_selector,
R.drawable.drawable_right_selector,
R.drawable.drawable_bottom_selector);
}
mEdit1 = (EditText) view.findViewById(R.id.edit1);
mEdit1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.drawable_left_selector,
R.drawable.drawable_top_selector,
R.drawable.drawable_right_selector,
R.drawable.drawable_bottom_selector);
mText1 = (TextView) view.findViewById(R.id.text1);
mText1.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.drawable_left_selector),
getResources().getDrawable(R.drawable.drawable_top_selector),
getResources().getDrawable(R.drawable.drawable_right_selector),
getResources().getDrawable(R.drawable.drawable_bottom_selector));
return view;
}
示例2: clearFocus
import android.widget.EditText; //導入方法依賴的package包/類
public static void clearFocus(EditText editText) {
editText.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
}
示例3: unSetErrorRight
import android.widget.EditText; //導入方法依賴的package包/類
public void unSetErrorRight(EditText editText, @DrawableRes int resId) {
editText.setCompoundDrawablesWithIntrinsicBounds(0, 0, resId, 0);
}