android.widget.CheckBox.getLayoutParams()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(154)

本文整理了Java中android.widget.CheckBox.getLayoutParams()方法的一些代码示例,展示了CheckBox.getLayoutParams()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CheckBox.getLayoutParams()方法的具体详情如下:
包路径:android.widget.CheckBox
类名称:CheckBox
方法名:getLayoutParams

CheckBox.getLayoutParams介绍

暂无

代码示例

代码示例来源:origin: Chion82/WeChatMomentStat-Android

protected void loadUserList() {
  LinearLayout userListContainer = (LinearLayout)findViewById(R.id.user_list_container);
  ArrayList<UserSnsInfo> userSnsList = Share.snsData.userSnsList;
  checkBoxList.clear();
  userListContainer.removeAllViews();
  for (int i=0;i<userSnsList.size();i++) {
    CheckBox userCheckBox = new CheckBox(this);
    userCheckBox.setText(userSnsList.get(i).userName + "(" + userSnsList.get(i).userId + ")" + "(" + String.format(getString(R.string.user_moment_count), userSnsList.get(i).snsList.size()) + ")");
    userListContainer.addView(userCheckBox);
    LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)userCheckBox.getLayoutParams();
    layoutParams.setMargins(5, 5, 5, 5);
    userCheckBox.setLayoutParams(layoutParams);
    userCheckBox.setChecked(true);
    userCheckBox.setTag(userSnsList.get(i).userId);
    checkBoxList.add(userCheckBox);
  }
}

代码示例来源:origin: derry/delion

- ViewCompat.getPaddingEnd(mStoreLocallyTooltipIcon)
- MarginLayoutParamsCompat.getMarginStart((RelativeLayout.LayoutParams)
    mStoreLocallyCheckbox.getLayoutParams())
- MarginLayoutParamsCompat.getMarginEnd((RelativeLayout.LayoutParams)
    mStoreLocallyTooltipIcon.getLayoutParams()));

代码示例来源:origin: supertaohaili/book

checkBox.setFocusable(false);
addView(checkBox);
layoutParams = (LayoutParams) checkBox.getLayoutParams();
layoutParams.width = LayoutParams.WRAP_CONTENT;
layoutParams.height = LayoutParams.WRAP_CONTENT;

相关文章