当前位置: 首页>>代码示例>>Java>>正文


Java TableRow.setPadding方法代码示例

本文整理汇总了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);

    }
 
开发者ID:vaginessa,项目名称:RepWifiApp,代码行数:34,代码来源:SelectNetworkActivity.java

示例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);
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:31,代码来源:DisplayUserFragment.java


注:本文中的android.widget.TableRow.setPadding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。