本文整理汇总了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);
}