Android Source code: (i) Android 2.1 to 4.4 operating system common Actionbar implementation of the tab navigation example.

Source: Internet
Author: User

Tell me what I'm trying to do before I finish this example.

First, modify the "Actionbarsherlock" navigation example. Before I implemented this example, I tried "actionbarsherlock" to modify one of its tab navigation examples, and the modification was successful. But finally found that it is not a actionbar implementation of the tab, can not hide Actionbar, when the Actionbar hide method is invoked, Actionbar is hidden, but the title of the tab page still exists, And in the lower version of Android (my Samsung I9100, Android 2.3), when the screen was turned on screen, Actionitem was unable to display it properly, and after the final measure, it was discarded.

There is a tab navigation example that does not directly support the Actionbar implementation of the Android 2.1 to 4.4 operating system. I really did not find ...

Finally, I decided to directly revise the "effectivenavigation" example provided by Google. The reason to revise this example: Google is now fully implemented Actionbar, and support the minimum version to 2.1. I think Google knows its Android best, and if it can be modified with the examples it offers, that's the best. I took a look at this example two days, and looked at a lot of examples of code-related articles, and finally proved that the Google example is actually the most ideal, the use of components is the most appropriate, so directly modify it.

We do not modify whether it can be used directly. OK, but the minimum version of Android is not 2.1, and for programs that want to support 2.1, then we have to revise.

After my efforts, the final revision succeeded, the program can now run on 2.3 to 4.4 of the Android device, I have used my two Samsung mobile phone and flat test finished. If you want to do a Actionbar tab navigation Android program and want to support Android 2.1 and above, you can download my example source directly, and continue to modify it to your own.

Now I do not make further changes to this example, the purpose is to make comparisons with Google's original source code.

Example full source download: http://download.csdn.net/detail/sunylat/8231537

Program Run screenshot:

Resources:

One, implementing effective navigation

Http://developer.android.com/training/implementing-navigation/index.html

Second, Actionbar:

Http://developer.android.com/training/basics/actionbar/index.html

Http://developer.android.com/training/basics/actionbar/setting-up.html

Http://developer.android.com/training/basics/actionbar/styling.html

     http://developer.android.com/training/basics/actionbar/overlaying.html

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.