2016-11-19 75 views
1

我目前在每個表單的頂部都有我的應用程序的Logo。由於需要大量空間,因此我希望它的大小可以縮小,用戶滾動得越多,就像許多應用程序一樣。Codename One:用滾動縮小圖像

我的徽標目前只是一個容器,在佈局中將徽標添加到NORTH。你們有沒有人已經實現了類似的東西,並可以給我一個提示如何實現這一點?

在此先感謝。

回答

1

看看title animations的博客文章。這是帖子的相關代碼:

Form hi = new Form("Shai's Social App", new BoxLayout(BoxLayout.Y_AXIS)); 
for(int iter = 0 ; iter < 100 ; iter++) { 
    hi.add(new Label("Social Data Goes here...")); 
} 
Toolbar tb = new Toolbar(); 
hi.setToolbar(tb); 
ComponentAnimation cna = tb.createStyleAnimation("TitleAreaClean", 200); 
ComponentAnimation title = tb.getTitleComponent().createStyleAnimation("TitleClean", 200); 
hi.getAnimationManager().onTitleScrollAnimation(cna, title); 
hi.show();