Recently, I made a small application on Android 2.3, native/Web hybrid, and used a webview to display the main content area. Jquery mobile's list and built-in search functions are used. The search box is at the top of the list. when the list is rolled up, the search box will scroll together to the top of the screen. After reading the demo, the customer said, "This is a good thing. It would be better if you can stay at the top 」. The subsequent events are as follows:
1. Set position: fix and modify various CSS margin/padding/top to ensure this ...... Fixed at the top of the page.
Chrome test succeeded, iPhone test succeeded, Android webview, and Android built-in browsers failed.
2, search Android browser fix top, see the http://bradfrostweb.com/blog/mobile/fixed-position/ said: must prohibit user scaling.
Add
<Meta name = "viewport" content = "width = device-width, user-scalable: No">
Test, you can still scale.
3, continue to search, see http://garrows.com /? P = 337CodeTo remove the brainless duplicates. The Code is as follows:
<Meta name = 'handheldfriendly' content = "true"/> <meta name = 'viewport' content = 'width = device-width; initial-scale = 1.0; maximum-scale = 1.0; User-scalable = 0; '/>
Scaling disabled. The search box is successfully topped after the scroll list.
4. Let me scroll it up and click the input box to see it ......
The input box is like this. The cursor below blinks, and it looks like the place in the input box cannot get the focus at all, and the white strip that can accept the focus will no longer be found.
5. Conclusion
...
IOS is really good, huh.
Above.