本文整理匯總了Java中android.widget.RadioButton.setVisibility方法的典型用法代碼示例。如果您正苦於以下問題:Java RadioButton.setVisibility方法的具體用法?Java RadioButton.setVisibility怎麽用?Java RadioButton.setVisibility使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.RadioButton
的用法示例。
在下文中一共展示了RadioButton.setVisibility方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: bindType
import android.widget.RadioButton; //導入方法依賴的package包/類
private void bindType(int id, RuleInfo ri) {
final RadioButton rb = (RadioButton) mTypes.findViewById(id);
if (ri == null) {
rb.setVisibility(View.GONE);
return;
}
rb.setVisibility(View.VISIBLE);
if (ri.caption != null) {
rb.setText(ri.caption);
}
rb.setTag(ri);
}
示例2: getView
import android.widget.RadioButton; //導入方法依賴的package包/類
/**
*
*/
@Override
public View getView(final int position, View convertView, final ViewGroup parent)
{
if (convertView == null)
{
final LayoutInflater inflater = ((Activity) context).getLayoutInflater();
convertView = inflater.inflate(R.layout.map_filter_item, parent, false);
}
final TextView titleTextView = (TextView) convertView.findViewById(android.R.id.title);
final TextView summaryTextView = (TextView) convertView.findViewById(android.R.id.summary);
final TextView subselectTextView = (TextView) convertView.findViewById(R.id.subselect);
final RadioButton checkedTextView = (RadioButton) convertView.findViewById(R.id.radiobutton);
// /
final ServerOption entry = (ServerOption) getItem(position);
if (isRootElement) {
checkedTextView.setVisibility(View.GONE);
}
String subOptions = "";
if (entry.isChecked()) {
for (ServerOption o : options.getSelectedSubOptions(entry)) {
subOptions = o.getTitle() + (subOptions.length() > 0 ? ", " : "") + subOptions ;
}
}
// /
subselectTextView.setText(subOptions);
titleTextView.setText(entry.getTitle());
summaryTextView.setText(entry.getSummary());
checkedTextView.setChecked(entry.isChecked());
return convertView;
}
示例3: setRadioDisChecked
import android.widget.RadioButton; //導入方法依賴的package包/類
/**
* 設置未所有Item為未選中
*/
private void setRadioDisChecked(ViewGroup parentView) {
if (parentView == null || parentView.getChildCount() < 1) {
return;
}
for (int i = 0; i < parentView.getChildCount(); i++) {
View itemView = parentView.getChildAt(i);
RadioButton rbSelect = (RadioButton) itemView.findViewById(R.id.rb_selected);
if (rbSelect != null) {
rbSelect.setVisibility(View.GONE);
rbSelect.setChecked(false);
}
}
}