Android development discipline

1. to add the controls, the bottom border

Sometimes some of the layout just up and down the border, you can view two View, placed at the upper and lower boundaries, the height of the view is set to 1, set the background, this is a way.

Another way, may be realized by layer-list, for example:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:left="-2dp"
        android:right="-2dp">

        <shape>
            <stroke
                android:width="1px"
                android:color="#64646A" />
        </shape>

    </item>

</layer-list>

2. to add a full border controls

It can be implemented as follows:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <stroke
        android:color="#64646A"
        android:width="1px" />
    <corners
        android:topLeftRadius="1dp"
        android:bottomLeftRadius="1dp"/>

</shape>

3. Cancel focus of property EditText

Sometimes when a page contains EditText controls, by default this control to get the focus of the page. If you do not want to get into this focus this control can be set by an increase in its sibling controls, as follows:

android:focusable="true"
android:focusableInTouchMode="true"

This setting can be deprived of default focus EditText

4: aapt given class

Such specific error can not see what went wrong, but according to AS on its own to separate runtime error module to see more detailed error information.

details as follows:

Generally there is an error point to a specific module, specific functions, such as: NewWindInfo: mergeReleaseResources, you can click on the right side of the [function] Gradle to expand the corresponding page;

Find NewWindInfo module, expand Tasks [module] - [other] expansion modules - find mergeReleaseResources, run this feature, you can view specific information.

Released four original articles · won praise 1 · views 578

Guess you like

Origin blog.csdn.net/hankesi/article/details/103962038