Android studio uses a tip: fill in data during layout Preview

We all know that Android studio is great to use, and the layout preview is even better. When adjusting the UI, we basically need real-time preview to see the effect. In Android studio, we only need to switch to design, and we need to fill in data on the layout. The preview effect is better. For example, we set the text attribute in textview to see whether the font size and layout are correct. However, in the formal environment, we need to remove these additional data, Otherwise, it looks very uncomfortable. At this time, I use a skill introduced in this blog.

Without much nonsense, go straight to the figure above:

In the above example, you only need to add the text attribute of the tools namespace in the XML layout file. This attribute has nothing to do with the officially released version. Isn't it cool?

Just add a namespace to the layout before using it

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>