Android icon vs logo

Source: Internet
Author: User

Android icon vs logo

The Android configuration file has two attributes: icon and logo. What are the differences between these two attributes?

Description of the icon attribute of the activity in the list file:

 

Android: icon

An icon representing the activity. the icon is displayed to users when a representation of the activity is required on-screen. for example, icons for activities that initiate tasks are displayed in the launcher window. the icon is often accompaniedby a label (see the android: label attribute ).

This attribute must be set as a reference to a drawable resource containing theimage definition. if it is not set, the icon specified for the application as awhole is used instead (see the element's icon attribute ).

Theactivity's icon-whether set here or by the element-is also the default icon for all the activity's intent filters (see Element's icon attribute ).

 

The icon represents an activity. It is displayed to the user as the activity interface, for example, the MainActivity icon on the startup interface. In addition, its property value must be a drawable type resource file. If the activity is not defined, the activity uses the icon attribute of the application.

The following is an introduction to the icon attribute of application:

 

Android: icon

An iconfor the application as whole, and the default icon for each of theapplication's components. See the individual icon attributesfor ,, , , And Elements.

This attribute must be set as a reference to a drawable resource containing the image (for example @ drawable/icon). There is no default icon.

Similar to the icon attribute of activity, the icon attribute of application does not have the default value. The icon attribute of aplication is used to display thumbnails on the installation page and installation package, excluding the desktop and starter icons. The figure displayed on the desktop and on the starter is the icon in the main activity (generally named MainActivity) of the application.

Logo attributes:

 

Android: logo

A logo for the application as whole, and the default logofor activities.

This attribute must be set as a reference to a drawableresource containing the image (for example @ drawable/logo). There is no default logo.


The logo will not be used as the desktop icon, but as the activity navigation chart. When the icon and logo attribute are set at the same time (idle), the logo will completely overwrite the icon.

 

Using a logo instead ofan icon

 

By default, the systemuses your application icon in the action bar, as specified by the icon attribute in the or element. however, if you also specifythe logo attribute, then the action bar usesthe logo image instead of the icon.

A logo shoshould usually bewider than the icon, but shoshould not include unnecessary text. you shouldgenerally use a logo only when it represents your brand in a traditional format that users recognize. A good example is the YouTube app's logo-the logorepresents the expected user brand, whereas the app's icon is a modifiedversion that conforms to the square requirement for the launcher icon.


Application of ActionBar:

 

ActionBar actionBar=getActionBar();

 

Use android: logo attribute. Unlike the regular icon, the logo image does not have any Width limit.

When you have a Logo, you can hide the label.

Hide Label labels:

actionBar.setDisplayShowTitleEnabled(false);

 

Hide logo and icon:

actionBar.setDisplayShowHomeEnabled(false);

 

By default, the actionBar is placed on the top of your activity and is part of the activity layout. After being set to overwrite mode, the actionBar is equivalent to floating above the activity without interfering with the activity layout.

 

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.