1.Description
tools: context = "activity name"
it won't be packaged into the apk
.Only ADT
Layout Editor in your current Layout file set corresponding rendering context, show your current Layout in rendering the context is the activity name corresponds to the activity, if the activity in the manifest
file set a Theme, then ADT
Layout Editor will render your current Layout according to the Theme.Means that if you set the MainActivity
set a Theme. The Light (the other), then you see in visual layout manager o background control of what should be the Theme. The Light looks like.Only to show you what you see is what you get results.
Some people see will understand some, some people see the also don't know, I'll add a few words of explanation:
2.Sample
Take a simple tools:text
, for example, some more image, convenient to further understand the tools:context
<TextView
android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sample name1" />
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="sample name2" />
TextView
1 adopted the android: text
, and use the tools:text
in the TextView
2, on the right side of the Layout editor will display the sample name1
, the sample name2
two font, if after you run the code to compile, generated apk
, terminal display only the sample name1
, does not show the sample name2
the words. You can try to run, see how the effect.
3.Specific description
1.The tools: context = "activity name"
it won't be packaged into the apk
(understanding: the equivalent of this is commented, the compiled no effect.)
2.Only ADT
Layout Editor (i.e., for the above icon on the right side of the simulator) in the current Layout file set corresponding rendering context, the Layout of the current XML in rendering the context is the activity name corresponds to the activity, if the activity in the manifest file set a Theme, then ADT
Layout Editor will render your current Layout according to the Theme.Means that if you set the MainActivity
set a Theme. The Light can also be (other).(understand: you added tools: context = "activity name"
, the XML layout is rendering specified activity, establishes a Theme in the manifest file, pictured above right simulator Theme style will also follow changes corresponding to the Theme.)
4.summary
To sum up, these properties mainly aimed at above the right tools, the simulator debugging time display status, and compile doesn't work,