android slidingMenu 实现原理

     android slidingMenu 主要分为customViewAbove 和customViewBehind 也就是 menu view和 content  view。

    具体说,slidingMenu是个RelativeLayout,customViewAbove and customViewBehind are all child views.

customViewBehid is in behind ,and they all layout in matchparent when in initial state. This initila position 是他们的永久位置,任何点击的操作对应的位置,就是这个初始的位置。

    when 显示菜单的时候,就是要对customViewAbove and customViewBehind 做scrollto() action,   这个时候menu暴露出来 响应任何的点击事件,而customViewAbove postion in margin.

   使用scrollto   rather than change view layoutmargin or padding ,can increase performance.

猜你喜欢

转载自lyp2002924.iteye.com/blog/2240974
今日推荐