android.widget.ImageButton.setMinimumWidth()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(134)

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

ImageButton.setMinimumWidth介绍

暂无

代码示例

代码示例来源:origin: ankidroid/Anki-Android

private void setDeckExpander(ImageButton expander, ImageButton indent, Sched.DeckDueTreeNode node){
  boolean collapsed = mCol.getDecks().get(node.did).optBoolean("collapsed", false);
  // Apply the correct expand/collapse drawable
  if (collapsed) {
    expander.setImageDrawable(mExpandImage);
    expander.setContentDescription(expander.getContext().getString(R.string.expand));
  } else if (node.children.size() > 0) {
    expander.setImageDrawable(mCollapseImage);
    expander.setContentDescription(expander.getContext().getString(R.string.collapse));
  } else {
    expander.setImageDrawable(mNoExpander);
  }
  // Add some indenting for each nested level
  int width = (int) indent.getResources().getDimension(R.dimen.keyline_1) * node.depth;
  indent.setMinimumWidth(width);
}

代码示例来源:origin: wdullaer/MaterialDateTimePicker

private void init() {
  dayPickerView = new SimpleDayPickerView(getContext(), controller);
  addView(dayPickerView);
  final LayoutInflater inflater = LayoutInflater.from(getContext());
  final ViewGroup content = (ViewGroup) inflater.inflate(R.layout.mdtp_daypicker_group, this, false);
  // Transfer all children from the content to this
  while (content.getChildCount() > 0) {
    final View view = content.getChildAt(0);
    content.removeViewAt(0);
    addView(view);
  }
  prevButton = findViewById(R.id.mdtp_previous_month_arrow);
  nextButton = findViewById(R.id.mdtp_next_month_arrow);
  if (controller.getVersion() == DatePickerDialog.Version.VERSION_1) {
    int size = Utils.dpToPx(16f, getResources());
    prevButton.setMinimumHeight(size);
    prevButton.setMinimumWidth(size);
    nextButton.setMinimumHeight(size);
    nextButton.setMinimumWidth(size);
  }
  if (controller.isThemeDark()) {
    int color = ContextCompat.getColor(getContext(), R.color.mdtp_date_picker_text_normal_dark_theme);
    prevButton.setColorFilter(color);
    nextButton.setColorFilter(color);
  }
  prevButton.setOnClickListener(this);
  nextButton.setOnClickListener(this);
  dayPickerView.setOnPageListener(this);
}

代码示例来源:origin: stackoverflow.com

public void onCreate(Bundle savedInstanceState) {  
 super.onCreate(savedInstanceState);  
 setContentView(R.layout.main);  
 ImageButton myButton = (ImageButton) findViewById(R.id.button);  
 Bitmap image = BitmapFactory.decodeResource(R.drawable.eye);  
 myButton.setBitmap(image);  
 myButton.setMinimumWidth(image.getWidth());  
 myButton.setMinimumHeight(image.getHeight());
 ...
}

代码示例来源:origin: stackoverflow.com

button.setMinimumHeight(60);
button.setMaxWidth(60);
button.setMinimumWidth(60);
button.setOnClickListener(AddImage);
this.addView(button);

相关文章

ImageButton类方法