在按钮中设置文本和图标之间的边距

阿姆里塔·斯塔(Amrita Stha)

如何设置按钮图标和文本之间的间距。在这里,我将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);
Shai Almog

这是一种特殊情况,称为“间隙”。例如bookingButton.setGap(pixels);Label.setDefaultGap(pixels);

另外,您可以使用主题常数labelGap该常数应映射到以毫米为单位的间隙大小。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章