本文整理匯總了Java中android.support.v7.widget.GridLayout.findViewById方法的典型用法代碼示例。如果您正苦於以下問題:Java GridLayout.findViewById方法的具體用法?Java GridLayout.findViewById怎麽用?Java GridLayout.findViewById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v7.widget.GridLayout
的用法示例。
在下文中一共展示了GridLayout.findViewById方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: TableCardLayout
import android.support.v7.widget.GridLayout; //導入方法依賴的package包/類
public TableCardLayout(Context context, AttributeSet attrs) {
super(context, attrs);
int leftRightPadding = getResources().getDimensionPixelOffset(R.dimen.padding_normal);
int topBottomPadding = getResources().getDimensionPixelOffset(R.dimen.padding_three_halves);
setContentPadding(leftRightPadding, topBottomPadding, leftRightPadding, topBottomPadding);
gridLayout = (GridLayout) LayoutInflater.from(getContext()).inflate(R.layout.pokemon_table_card, this, false);
titleView = (TextView) gridLayout.findViewById(R.id.title);
addView(gridLayout);
if (attrs != null) {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TableCardLayout);
String title = a.getString(R.styleable.TableCardLayout_android_title);
if (title != null) {
titleView.setText(title);
}
a.recycle();
}
if (isInEditMode()) {
setData(Arrays.asList(
new Row("speed", "45"),
new Row("special-defense", "65"),
new Row("special-attack", "65"),
new Row("defense", "49"),
new Row("attack", "49"),
new Row("hp", "45")
));
}
}
示例2: onCreateView
import android.support.v7.widget.GridLayout; //導入方法依賴的package包/類
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mGridLayout = (GridLayout) inflater.inflate(R.layout.fragment_backup_gridlayout, container, false);
tvFromDatePicker = mGridLayout.findViewById(R.id.tvFromDatePicker);
tvToDatePicker = mGridLayout.findViewById(R.id.tvToDatePicker);
spFormats = mGridLayout.findViewById(R.id.spFormats);
ResourcesHelper.setLeftCompoundDrawable(mGridLayout, R.id.tvFrom, R.drawable.calendar_today);
ResourcesHelper.setLeftCompoundDrawable(mGridLayout, R.id.tvTo, R.drawable.calendar);
ResourcesHelper.setLeftCompoundDrawable(mGridLayout, R.id.tvType, R.drawable.file);
tvFromDatePicker.setOnClickListener(this);
tvToDatePicker.setOnClickListener(this);
tvFromDatePicker.setText(DateTimeHelper.convertLocalDateToString(mFromDate));
tvToDatePicker.setText(DateTimeHelper.convertLocalDateToString(mToDate));
if (null != savedInstanceState) {
spFormats.setSelection(savedInstanceState.getInt(KEY_SELECTED_FORMAT_INT, 0));
}
if (null != mAsyncTask) {
// To start progress dialog again.
mAsyncTask.onPreExecute();
}
return mGridLayout;
}
示例3: initView
import android.support.v7.widget.GridLayout; //導入方法依賴的package包/類
private void initView() {
// inflate numpad
numpadLayout = (GridLayout) inflate(getContext(), R.layout.view_num_pad, null);
addView(numpadLayout);
// set icon for the delete button
final AppCompatImageButton deleteButton = (AppCompatImageButton) numpadLayout.findViewById(R.id.numpad_delete_btn);
final IconicsDrawable deleteIcon = IconUtils.icon(getContext(), GoogleMaterial.Icon.gmd_tag_backspace, R.color.white, 20);
deleteButton.setImageDrawable(deleteIcon);
// add listeners
for (int i = 0; i < numpadLayout.getChildCount(); i++) {
numpadLayout.getChildAt(i).setOnClickListener(new NumpadButtonListener());
}
}