Introduction to Android Development (eight) using Activity Bar 8.1 to manipulate Actionbar

Source: Internet
Author: User

In addition to fragments (fragments), new additions in ANDROID3 and 4, and actionbar (activity bar). Actionbar is located in the traditional title bar at the top of the device screen. Actionbar shows the application icon and the title of the activity. Optionally, the right side of the Actionbar is those action items (active items). The following illustration shows the build-in (built-in) email application, showing the application icon, the activity's title, and some activity items. The next section discusses the action items (active items) in more detail.

The following example will show you how to hide and display Actionbar by writing code.

1. Create a project, Myactionbar.

2. Press F11 to debug on the simulator. At this point, you will see that Actionbar is placed at the top of the screen (including the applied icon and the name "Myactionbar"). The following figure.

3. To hide Actionbar, you can add the following code to the Androidmanifest.xml.

<?xml version= "1.0" encoding= "Utf-8"?> <manifest xmlns:android= "Http://schemas.android.com/apk/res/androi"     
         
    D "package=" Net.learn2develop.MyActionBar "android:versioncode=" 1 "android:versionname=" 1.0 "> <uses-sdk android:minsdkversion= "/> <application android:icon=" @drawabl E/ic_launcher "android:label=" @string/app_name "> <activity android:label=" @strin G/app_name "Android:name=". Myactionbaractivity "<!--note that this line of code--> android:theme=" @android: Style/theme.holo.noactionbar " > <intent-filter > <action android:name= "Android.intent.action.MAIN"/&G     
         
                T <category android:name= "Android.intent.category.LAUNCHER"/> </intent-filter> &l T;/activity> </application> </manifeSt> 

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.