プログラムで描画可能なサイズを設定する
画像(アイコン)のサイズはほぼ同じですが、ボタンの高さを同じに保つためにサイズを変更する必要があります。 どうすればよいですか? Button button = new Button(this); button.setText(apiEventObject.getTitle()); button.setOnClickListener(listener); /* * set clickable id of button to actual event id */ int id = Integer.parseInt(apiEventObject.getId()); button.setId(id); button.setLayoutParams(new LayoutParams( android.view.ViewGroup.LayoutParams.FILL_PARENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT)); Drawable drawable = LoadImageFromWebOperations(apiSizeObject.getSmall()); //?resize drawable here? drawable.setBounds(50, 50, 50, 50); button.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null);