本文整理匯總了Java中android.widget.TableLayout.findViewById方法的典型用法代碼示例。如果您正苦於以下問題:Java TableLayout.findViewById方法的具體用法?Java TableLayout.findViewById怎麽用?Java TableLayout.findViewById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.TableLayout
的用法示例。
在下文中一共展示了TableLayout.findViewById方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreateView
import android.widget.TableLayout; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.coin_layout, container, false);
if (Cache.topDivs == null || Cache.topDivs.equals("")) return rootView;
TableLayout tl = (TableLayout) rootView.findViewById(R.id.item_table);
try {
JSONObject obj = new JSONObject(Cache.bottomDivs);
Iterator<String> keys = obj.keys();
while (keys.hasNext()) {
String key = keys.next();
String market = key.split("-")[0];
if (!market.contains("btc")) continue;
String strType = key.split("-")[1];
TableLayout tlx = (TableLayout) inflater.inflate(R.layout.item_layout, container, false);
TextView level = (TextView) tlx.findViewById(R.id.level);
TextView reliability = (TextView) tlx.findViewById(R.id.reliability);
TextView time = (TextView) tlx.findViewById(R.id.div_time);
level.setText(strType);
reliability.setText(obj.getJSONObject(key).getDouble("reliability") + "");
time.setText(obj.getJSONObject(key).getString("cur_div_time"));
tl.addView(tlx);
}
} catch (JSONException e) {
e.printStackTrace();
}
return rootView;
}
示例2: initPinDigitButton
import android.widget.TableLayout; //導入方法依賴的package包/類
private void initPinDigitButton(final TableLayout keyboardLayout, final int buttonId, final int buttonValue) {
final Button pinButton = (Button) keyboardLayout.findViewById(buttonId);
pinButton.setOnClickListener(v -> onDigitKeyClicked(buttonValue));
}
示例3: initPinDeleteButton
import android.widget.TableLayout; //導入方法依賴的package包/類
private void initPinDeleteButton(final TableLayout keyboardLayout, final int buttonId) {
deleteButton = (ImageButton) keyboardLayout.findViewById(buttonId);
deleteButton.setOnClickListener(v -> onDeleteKeyClicked());
}