本文整理汇总了Java中android.widget.AutoCompleteTextView.setDropDownVerticalOffset方法的典型用法代码示例。如果您正苦于以下问题:Java AutoCompleteTextView.setDropDownVerticalOffset方法的具体用法?Java AutoCompleteTextView.setDropDownVerticalOffset怎么用?Java AutoCompleteTextView.setDropDownVerticalOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.AutoCompleteTextView
的用法示例。
在下文中一共展示了AutoCompleteTextView.setDropDownVerticalOffset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyStyle
import android.widget.AutoCompleteTextView; //导入方法依赖的package包/类
private static void applyStyle(AutoCompleteTextView v, int styleRes){
TypedArray a = v.getContext().obtainStyledAttributes(null, R.styleable.AutoCompleteTextView, 0, styleRes);
int n = a.getIndexCount();
for (int i = 0; i < n; i++) {
int attr = a.getIndex(i);
if(attr == R.styleable.AutoCompleteTextView_android_completionHint)
v.setCompletionHint(a.getString(attr));
else if(attr == R.styleable.AutoCompleteTextView_android_completionThreshold)
v.setThreshold(a.getInteger(attr, 0));
else if(attr == R.styleable.AutoCompleteTextView_android_dropDownAnchor)
v.setDropDownAnchor(a.getResourceId(attr, 0));
else if(attr == R.styleable.AutoCompleteTextView_android_dropDownHeight)
v.setDropDownHeight(a.getLayoutDimension(attr, ViewGroup.LayoutParams.WRAP_CONTENT));
else if(attr == R.styleable.AutoCompleteTextView_android_dropDownWidth)
v.setDropDownWidth(a.getLayoutDimension(attr, ViewGroup.LayoutParams.WRAP_CONTENT));
else if(attr == R.styleable.AutoCompleteTextView_android_dropDownHorizontalOffset)
v.setDropDownHorizontalOffset(a.getDimensionPixelSize(attr, 0));
else if(attr == R.styleable.AutoCompleteTextView_android_dropDownVerticalOffset)
v.setDropDownVerticalOffset(a.getDimensionPixelSize(attr, 0));
else if(attr == R.styleable.AutoCompleteTextView_android_popupBackground)
v.setDropDownBackgroundDrawable(a.getDrawable(attr));
}
a.recycle();
}
示例2: applyStyle
import android.widget.AutoCompleteTextView; //导入方法依赖的package包/类
/**
* Apply any AutoCompleteTextView style attributes to a view.
* @param v
* @param attrs
* @param defStyleAttr
* @param defStyleRes
*/
private static void applyStyle(AutoCompleteTextView v, AttributeSet attrs, int defStyleAttr, int defStyleRes){
TypedArray a = v.getContext().obtainStyledAttributes(attrs, R.styleable.AutoCompleteTextView, defStyleAttr, defStyleRes);
int n = a.getIndexCount();
for (int i = 0; i < n; i++) {
int attr = a.getIndex(i);
if(attr == R.styleable.AutoCompleteTextView_android_completionHint)
v.setCompletionHint(a.getString(attr));
else if(attr == R.styleable.AutoCompleteTextView_android_completionThreshold)
v.setThreshold(a.getInteger(attr, 0));
else if(attr == R.styleable.AutoCompleteTextView_android_dropDownAnchor)
v.setDropDownAnchor(a.getResourceId(attr, 0));
else if(attr == R.styleable.AutoCompleteTextView_android_dropDownHeight)
v.setDropDownHeight(a.getLayoutDimension(attr, ViewGroup.LayoutParams.WRAP_CONTENT));
else if(attr == R.styleable.AutoCompleteTextView_android_dropDownWidth)
v.setDropDownWidth(a.getLayoutDimension(attr, ViewGroup.LayoutParams.WRAP_CONTENT));
else if(attr == R.styleable.AutoCompleteTextView_android_dropDownHorizontalOffset)
v.setDropDownHorizontalOffset(a.getDimensionPixelSize(attr, 0));
else if(attr == R.styleable.AutoCompleteTextView_android_dropDownVerticalOffset)
v.setDropDownVerticalOffset(a.getDimensionPixelSize(attr, 0));
else if(attr == R.styleable.AutoCompleteTextView_android_popupBackground)
v.setDropDownBackgroundDrawable(a.getDrawable(attr));
}
a.recycle();
}