Android 2.3 webview bug position: fix

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.