viewflow的兼容问题

    本打算用ViewFlow来实现项目中的相关功能的。在该项目的主页 里作者只是提醒在api level8以下注意事项

The manifest states a min sdk version of 4, which is true. But in any case you want to support an api level < 8 you will have to forward an onConfigurationChanged event to the ViewFlow from your Activity. I know this isn't a very nice solution, feel free to propose better ones!

    以为符合我们的项目支持android 2.2以上设备的需求,编译才发现该控件要api level11 以上才行。翻阅代码才发现该控件时使用了View类里从api 11才支持的函数(getMeasuredState)和常量(MEASURED_STATE_MASK、MEASURED_HEIGHT_STATE_SHIFT)。

    稍微修改了一下代码兼容api level 4以上设备。

你可能感兴趣的:(level,viewpager,api,viewflow,11)