如何设置按钮图标和文本之间的间距。在这里,我将textPosition设置为Label.BOTTOM。在图标样式中设置边距或填充无效。
码:
style.setMarginBottom(100);
style.setPaddingBottom(100);
FontImage bookingIcon = FontImage.createMaterial(FontImage.MATERIAL_FILTER_NONE, style, 4);
Button bookingButton = new Button(bookingIcon);
bookingButton.setUIID("SeparateLine");
bookingButton.setText("Book");
bookingButton.setTextPosition(Label.BOTTOM);
这是一种特殊情况,称为“间隙”。例如bookingButton.setGap(pixels);
或Label.setDefaultGap(pixels);
。
另外,您可以使用主题常数labelGap
,该常数应映射到以毫米为单位的间隙大小。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句