"Turn" Android tools:context

Source: Internet
Author: User

tools:context="com.example.guolin.scrollertest.MainActivity"有时候可以看到有这个东西,但是从来没有用过,不知道有什么作用。猜测:这样的意思是把MainActivity加载进来吗??还是怎么的??有没有用到tools的DEMO啊?


toolsThe related properties are hints to the editor, which is used to assist the editor to show the effect, and these properties are not useful on the real machine. For example, tools:context this is to layout associate this file with the following Activity , so that when the editor shows the layout effect, it can target Activity some of the properties for targeted processing.

/************************************************************/

tools:context= the phrase "activity name" will not be packaged into the APK.

Just the layout editor of ADT sets the corresponding render context in your current layout file,

Indicates that the rendering context where your current layout is located is the activity of activity name,

If the activity has a theme set in the manifest file,

Then the ADT Layout Editor will render your current layout according to this theme.

That is, if you set the mainactivity set a theme.light (others can),

Then you see in the visual layout manager of the background of a control ah or something should be theme.light look.

Just to show you what you see and what you get.

from:http://blog.csdn.net/cdl343794966/article/details/13168059

from:https://segmentfault.com/q/1010000004444220?_ea=611520

"Turn" Android tools:context

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.