當前位置: 首頁>>代碼示例>>Java>>正文


Java EditText.setCompoundDrawablesWithIntrinsicBounds方法代碼示例

本文整理匯總了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;
}
 
開發者ID:ximsfei,項目名稱:Android-skin-support,代碼行數:24,代碼來源:LastFragment.java

示例2: clearFocus

import android.widget.EditText; //導入方法依賴的package包/類
public static void clearFocus(EditText editText) {
    editText.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
}
 
開發者ID:huashengzzz,項目名稱:SmartChart,代碼行數:4,代碼來源:CommonUtils.java

示例3: unSetErrorRight

import android.widget.EditText; //導入方法依賴的package包/類
public void unSetErrorRight(EditText editText, @DrawableRes int resId) {
    editText.setCompoundDrawablesWithIntrinsicBounds(0, 0, resId, 0);
}
 
開發者ID:parthdave93,項目名稱:AndroidTestingTutorial,代碼行數:4,代碼來源:LoginActivity.java


注:本文中的android.widget.EditText.setCompoundDrawablesWithIntrinsicBounds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。