开发者

How to have a Side window

I found a nice feature in Do开发者_StackOverflow社区lphin browser that brings another window from the side on a side-swipe. It's like the window is connected and revealed by swipe. See image below. Anyone knows how it is done?

How to have a Side window


I might be wrong but my guess would be they use a SlidingDrawer set to a lanscape orientation in a portrait layout (so it comes from the side rather than the top/bottom).

EDIT: Ok, I see now - I was rushing to go to work and didn't pick up on the fact the left hand side is displaced.

I suppose you could use two opposing SlidingDrawer views and force one to be initially open and the other initially closed. If their 'handle' views were identical and overlapped, then the effect would be similar to what you are seeing.

I'm not sure if the 'purists' would approve as the SlidingDrawer is meant to be used in an overlay fashion, i.e., it is meant to cover an existing view rather than to appear to move another out of the way. Then again, I've been coding for many years and often go on the principle that if it works why not use it?

Alternatively, there is some example code on smooth horizontal view scrolling in the answer to this question if it is of use. Horizontal Scrolling with fling gesture - ebook reader

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜