本文整理汇总了Java中android.widget.TableRow.setPadding方法的典型用法代码示例。如果您正苦于以下问题:Java TableRow.setPadding方法的具体用法?Java TableRow.setPadding怎么用?Java TableRow.setPadding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.TableRow
的用法示例。
在下文中一共展示了TableRow.setPadding方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addButtonForNetwork
import android.widget.TableRow; //导入方法依赖的package包/类
private void addButtonForNetwork(AccessPointInfo info) {
TableLayout s = (TableLayout) findViewById(R.id.table_networks);
TableLayout.LayoutParams tableParams = new TableLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
TableRow row = new TableRow(this);
TableRow.LayoutParams rowParams = new TableRow.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
rowParams.gravity = Gravity.FILL_HORIZONTAL;
row.setPadding(10, 10, 10, 10);
row.setLayoutParams(rowParams);
row.setGravity(Gravity.FILL_HORIZONTAL);
row.setLayoutParams(rowParams);
NetworkButton button = new NetworkButton(this, info.getBssid());
TableRow.LayoutParams params = new TableRow.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
button.setLayoutParams(params);
button.setBackground(getResources().getDrawable(R.drawable.repwifi_button));
button.setTextColor(Commons.colorThemeLight);
button.setTextSize(20);
button.setPadding(25, 10, 25, 10);
button.setGravity(Gravity.CENTER_HORIZONTAL);
button.setText(info.getSsid(20));
button.setOnClickListener(this);
row.addView(button, params);
row.setGravity(Gravity.CENTER_HORIZONTAL);
s.addView(row, tableParams);
s.setGravity(Gravity.FILL_HORIZONTAL);
}
示例2: displayFoundUser
import android.widget.TableRow; //导入方法依赖的package包/类
private void displayFoundUser(final View view, final String name, final String email) {
if (view == null || name == null || name.equals("")) {
throw new IllegalArgumentException();
}
TableLayout table = (TableLayout) view.findViewById(R.id.table);
TableRow tableRow = new TableRow(this.getContext());
//tableRow.setBackgroundColor(getResources().getColor(R.color.colorAccent));
tableRow.setPadding(20, 20, 20, 5);
TableRow.LayoutParams layoutParams = new TableRow.LayoutParams();
layoutParams.setMargins(50, 40, 40, 40);
TextView nameTextView = new TextView(this.getContext());
nameTextView.setText(name);
nameTextView.setTextSize(22);
nameTextView.setTextColor(getResources().getColor(R.color.cast_expanded_controller_text_color));
nameTextView.setLayoutParams(layoutParams);
tableRow.addView(nameTextView);
tableRow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((SideBarActivity) getActivity()).searchViewAsMenuItem.collapseActionView();
listener.onDisplayProfileFragmentInteraction(name, email);
}
});
table.addView(tableRow);
}