本文整理了Java中android.widget.Spinner.getChildAt()
方法的一些代码示例,展示了Spinner.getChildAt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spinner.getChildAt()
方法的具体详情如下:
包路径:android.widget.Spinner
类名称:Spinner
方法名:getChildAt
暂无
代码示例来源:origin: RobotiumTech/robotium
/**
* Checks if a given text is selected in a given {@link Spinner}
* @param spinnerIndex the index of the spinner to check. 0 if only one spinner is available
* @param text the text that is expected to be selected
* @return true if the given text is selected in the given {@code Spinner} and false if it is not
*/
public boolean isSpinnerTextSelected(int spinnerIndex, String text)
{
Spinner spinner = waiter.waitForAndGetView(spinnerIndex, Spinner.class);
TextView textView = (TextView) spinner.getChildAt(0);
if(textView.getText().equals(text))
return true;
else
return false;
}
}
代码示例来源:origin: stackoverflow.com
// set errors
for (Map.Entry<String, List<String>> error : errors.entrySet()) {
int id = getActivity().getResources().getIdentifier("edit_" + error.getKey(), "id", getActivity().getPackageName());
View edit = getActivity().findViewById(id);
if (!error.getValue().isEmpty() && edit instanceof TextView) {
TextView mTextView;
mTextView = (TextView)edit;
mTextView.setError(error.getValue().get(0));
} else if (!error.getValue().isEmpty() && edit instanceof Spinner){
Spinner mSpinner;
mSpinner = (Spinner)edit;
((TextView)mSpinner.getChildAt(0)).setError(error.getValue().get(0));
}
}
代码示例来源:origin: com.jayway.android.robotium/robotium-solo
/**
* Checks if a given text is selected in a given {@link Spinner}
* @param spinnerIndex the index of the spinner to check. 0 if only one spinner is available
* @param text the text that is expected to be selected
* @return true if the given text is selected in the given {@code Spinner} and false if it is not
*/
public boolean isSpinnerTextSelected(int spinnerIndex, String text)
{
Spinner spinner = waiter.waitForAndGetView(spinnerIndex, Spinner.class);
TextView textView = (TextView) spinner.getChildAt(0);
if(textView.getText().equals(text))
return true;
else
return false;
}
}
代码示例来源:origin: stackoverflow.com
TextView tvSpinner = ((TextView) spinner.getChildAt(0));
tvSpinner.setPadding(0, 0, 0, 0);
tvSpinner.setGravity(Gravity.CENTER);
代码示例来源:origin: stackoverflow.com
System.out.println("ChildCount =" + b);
for (int i = 0; i < b; i++) {
View v = spinner.getChildAt(i);
if (v == null) {
System.out.println("View not found");
代码示例来源:origin: nglauber/dominando_android2
private void exibirItem(int position) {
((TextView)mSpinner.getChildAt(0)).setTextColor(Color.WHITE);
String[] titulosAbas = getResources().getStringArray(R.array.secoes);
TypedArray bgColors = getResources().obtainTypedArray(R.array.cores_bg);
TypedArray textColors = getResources().obtainTypedArray(R.array.cores_texto);
SegundoNivelFragment fragment =
SegundoNivelFragment.novaInstancia(
titulosAbas[position],
bgColors.getColor(position, 0),
textColors.getColor(position, 0));
FragmentManager fm = getSupportFragmentManager();
Fragment f = fm.findFragmentByTag("tag");
FragmentTransaction ft = fm.beginTransaction();
ft.replace(R.id.container, fragment, "tag");
if (f != null) {
ft.addToBackStack(null);
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
}
ft.commit();
}
}
内容来源于网络,如有侵权,请联系作者删除!