相关疑难解决方法(0)

Javafx旋转标签问题

  • 当我尝试将标签旋转270时,我遇到了问题label.setRotate(270).
  • 但标签文字消失了.

标签文字消失了

  • 这是代码示例.

    LineChart chart = new LineChart(new CategoryAxis(), new NumberAxis());
    chart.setLegendVisible(false); 
    
    /**
     * Grid pane which contain the charts and vertical label to indicate for the row title
     */
    GridPane root = new GridPane();
    root.add(chart, 0, 0);
    
    /**
     * Want to add vertical label to refer to the row title.
     */
    Label label = new Label("Row Title");
    label.setRotate(270);
    // label.setMinWidth(200); 
    
    root.add(label, 1, 0);
    
    Run Code Online (Sandbox Code Playgroud)

更新

  • 当我尝试setMinWidth(200)出现另一个问题时. 旋转后,标签仍然占据宽度空间

javafx-2

6
推荐指数
1
解决办法
1603
查看次数

标签 统计

javafx-2 ×1