2013-05-31 65 views

回答

2

如果你想只改變滾動面板的滾動條的方向,你可以添加以下的CSS規則到面板

direction: rtl; 

我厭倦了這一點,它的工作原理。看看這個代碼。

ScrollPanel scrollPanel = new ScrollPanel(new Label("I am just wondering... How to set vertical scroll bar from right to left side for ScrollPanel in pure GWT? Or maybe there is some alt walk-around?I am just wondering... How to set vertical scroll bar from right to left side for ScrollPanel in pure GWT? Or maybe there is some alt walk-around?I am just wondering... How to set vertical scroll bar from right to left side for ScrollPanel in pure GWT? Or maybe there is some alt walk-around?I am just wondering... How to set vertical scroll bar from right to left side for ScrollPanel in pure GWT? Or maybe there is some alt walk-around?I am just wondering... How to set vertical scroll bar from right to left side for ScrollPanel in pure GWT? Or maybe there is some alt walk-around?I am just wondering... How to set vertical scroll bar from right to left side for ScrollPanel in pure GWT? Or maybe there is some alt walk-around?I am just wondering... How to set vertical scroll bar from right to left side for ScrollPanel in pure GWT? Or maybe there is some alt walk-around?I am just wondering... How to set vertical scroll bar from right to left side for ScrollPanel in pure GWT? Or maybe there is some alt walk-around?I am just wondering... How to set vertical scroll bar from right to left side for ScrollPanel in pure GWT? Or maybe there is some alt walk-around?I am just wondering... How to set vertical scroll bar from right to left side for ScrollPanel in pure GWT? Or maybe there is some alt walk-around?I am just wondering... How to set vertical scroll bar from right to left side for ScrollPanel in pure GWT? Or maybe there is some alt walk-around?I am just wondering... How to set vertical scroll bar from right to left side for ScrollPanel in pure GWT? Or maybe there is some alt walk-around?I am just wondering... How to set vertical scroll bar from right to left side for ScrollPanel in pure GWT? Or maybe there is some alt walk-around?")); 
    scrollPanel.setSize("100px", "100px"); 
    scrollPanel.setTitle("mypanel"); 
    scrollPanel.addStyleName("dit"); 
    RootPanel.get().add(scrollPanel); 

和CSS類是像

.dit { 
    direction: rtl; 
    text-align: left !important; /*Only if you want to set text alignment to left.*/ 
} 

(僅測試鉻)

+0

我試圖設置這個CSS樣式setStyleName( 「UI-右滾動」);但它使ScrollPanel小部件的文本正確對齊,但不能替代垂直滾動條本身:( – user592704

+0

)這是非常有趣的想法,我嘗試了方向:rtl,它真的將垂直滾動條替換爲左側,但是所有ScrollPanel內容文本都變得反映出來瞭如在鏡子中:S但我只是想將垂直滾動條從其默認的右側位置替換爲左側滾動條但不反映其所有內容:(我如何修復全部內容反射效果?是否有方法替換垂直滾動條而不是反映它的所有內容? – user592704

+0

你必須深入挖掘CSS,並且應該爲CSS的每一個元素都應用一個seperete CSS,沒有任何絕對的方法可以做到這一點。祝你好運:-)嘗試設置滾動面板的內容方向:ltr!important;可以幫助你 –