如何设置<ImageView>
的边距和填充?
我做了fx-padding: 50px;
和fx-margin: 50px;
,但它不起作用。
我的代码:
<ImageView style="fx-padding: 50px; fx-margin: 50px;"
fitHeight="120" fitWidth="120" fx:id="image" onMousePressed="#mousePressed">
</ImageView>
看看property list of ImageView
;没有这样的属性或任何可以使您达到类似效果的属性。您可能可以使用父布局的布局参数来实现效果;如果不可能的话;您需要将ImageView
包装在允许这样做的布局中,例如:
ImageView