0
Q
帶圖像的按鈕樣式
A
回答
4
的關鍵是contentDisplay
屬性,將其設置爲 「TOP」。
隨着FXML:
<Button contentDisplay="TOP" layoutX="101.0" layoutY="51.0" mnemonicParsing="false" text="Button">
<graphic>
<ImageView mouseTransparent="true" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@image.png" preserveRatio="false" smooth="false" />
</image>
</ImageView>
</graphic>
</Button>
或CSS:
.your-selector {
-fx-content-display: top;
}
檢查CSS參考here。
2
你可以簡單地實現,只是做
Button b = new Button("text", graphics);
b.setContentDisplay(ContentDisplay.TOP);
而涼爽的圖標,看看http://fxexperience.com/controlsfx/features/它包括從ICONE和FontAwesomeIcoMoon
相關問題
- 1. CSS圖像按鈕樣式
- 2. Android圖像按鈕樣式
- 3. Appcelerator的樣式按鈕圖像的Android
- 4. 如何設置帶背景圖像的按鈕樣式
- 5. 帶自定義圖像的樣式單選按鈕
- 6. 帶圖像格式的單選按鈕
- 7. 在android中的圖像按鈕樣式
- 8. 像旋鈕一樣的圖像按鈕
- 9. 帶圖像的FLTK按鈕
- 10. 帶圖像的按鈕
- 11. 帶圖像的WPF按鈕
- 12. 讓我的按鈕樣式像AlertDialog按鈕樣式
- 13. 樣式HTML「提交」按鈕與圖像?
- 14. 帶圖像和文字的按鈕,放置圖像的方式
- 15. 帶按鈕的樣式問題
- 16. 帶樣式的數據綁定按鈕
- 17. 帶鍵盤按鈕樣式的UIButton
- 18. 帶有UIActionSheet樣式按鈕的iPhone UIToolbar
- 19. 如何使用不帶圖像的CSS設置span單選按鈕的樣式
- 20. 如何使用WPF中的樣式按下按鈕圖像
- 21. 帶文本和圖像的HTML按鈕
- 22. Android:帶圖像的全息按鈕
- 23. iOS:帶按鈕圖像的導航欄
- 24. 帶文本和圖像的Android按鈕
- 25. 帶有透明度的圖像按鈕
- 26. 帶圖像的自定義按鈕
- 27. HTML +帶文本和圖像的按鈕
- 28. 帶動畫的UIButton圖像按鈕
- 29. 帶圖像的Windows Phone 7按鈕
- 30. 帶有純HTML/CSS圖像的按鈕
對不起,我不小心downvoted ...唯一的辦法我發現取消downvote是讓你先編輯你的帖子(只需添加一個點)。 http://meta.stackexchange.com/questions/139949/unable-to-undo-downvote –