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

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

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

ImageButton.setMinimumHeight介绍

暂无

代码示例

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

float density = getContext().getResources().getDisplayMetrics().density;
mKeyHeight = (int) (56 * density);
....
@Override
public View getView(int position, View convertView, ViewGroup parent) {
  ImageButton b = (ImageButton) convertView;
  if (b == null) {
    b = new ImageButton(getContext());
    b.setMinimumHeight(mKeyHeight);
    b.setBackgroundResource(R.drawable.btn_keyboard_key);
    b.setOnClickListener(this);
  }
}

代码示例来源: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.setImageResource(R.drawable.ic_launcher);
button.setMaxHeight(60);
button.setMinimumHeight(60);
button.setMaxWidth(60);
button.setMinimumWidth(60);

相关文章

ImageButton类方法