1
checkbox
有固定大小。我不知道checkbox
默認傾角大小。或者我怎樣才能得到默認的傾角大小。什麼是複選框默認大小
checkbox
有固定大小。我不知道checkbox
默認傾角大小。或者我怎樣才能得到默認的傾角大小。什麼是複選框默認大小
您可以覆蓋onWindowFocusChanged
方法和裏面就可以計算出CheckBox
寬度/高度編程
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
int checkBoxWidthInPx = mCheckBox.getWidth(); // return the width of your checkbox, in pixels.
int checkBoxHeightInPx = mCheckBox.getHeight();
// conver px to dp
int checkBoxWidthInDp = checkBoxWidthInPx/this.getResources().getDisplayMetrics().density
int checkBoxHeightInDp = checkBoxHeightInPx/this.getResources().getDisplayMetrics().density
}