當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。