Key data on the Android ui interface causes loss restart

Take a look at a simple example:

Completed looks like the figure below ~

Click the Save button below the screen, re-preview interface looks like the following figure:

When comparing two images will find, input boxes and check boxes selected content has changed.

The problem in the preparation of the interface more functional script, it is prone.

We look at the interface layout code in the input box the name of the property, two input boxes are exactly the same, the same checkbox is the problem.

You might say that what's the problem, in fact, the problem is caused by the same name because the interface elements , key in the data storage interface when not distinguish between multiple input boxes, multiple checkboxes, multiple drop-down box, but through record the name and content data.

We look at its specific forms of storage: Open the ui button on the device configuration folder.

According to the date when we can see it, it is just the second file I tested the resulting ui profile. Because the name is too long, in order not to wrong name, we read about it by traversing command.

Current script Line 4: { "input box 1": "This is the second sentence", "check box 1": to true, "drop-down box 1 ': 1}

I singled out look, ui configuration file which can be read only the name and content, then the name of the same person, when they will be offset, but only one of them.

Of course, the same name is not limited to the same interface elements, for different interface elements are the same, for example, you put the name on the check box write "input box 1", that is to interface it can not distinguish in the end is a checkbox or input box, only recognize the name, and thus give rise to confusion.

So for us to write complex interface, be sure to note that the interface to all involved in the "Name:" places, names are not repeated.

Another point is that the check boxes, drop-down box, click a button as well as respond to events, this property is also not the same name.

The problem is we often ask, so special to write an article, you can view more Past articles

Published 28 original articles · won praise 3 · views 10000 +

Guess you like

Origin blog.csdn.net/biao197/article/details/101797102