AbsoluteLayout.LayoutParams layoutparams = new AbsoluteLayout.LayoutParams((int) (datashow.nWidth * wr), (int) (datashow.nHeight * hr), (int) (datashow.nLp * wr), (int) (datashow.nTp * hr)); Button buttonView = new Button(this); buttonView.setPadding(1, 1, 1, 1);// 让数字全部显示出来 Button dataView = updateDataShow(buttonView, datashow); abslayout.addView(dataView, layoutparams);
原因:button上文字与button的框边界距离太大,导致文字无法显示全部
解决:设置pad
时间: 2024-10-01 16:54:48