Android development of the use of a small padding skills

Classification: Android finishing 251 people read Comment(1) Collection Report

In Android application development, sometimes the use of the status button (which can be clicked when the background is not the same as when you can not click), and the product requirements of the button size is fixed. The text on the button on the mobile phone shows that there may be some exceptions (mainly when the button is in the background, it is easy to appear), then how do we deal with it? We can use this property to padding.

Look at small examples:

-------------------------- is a button, but what is state selector-------------------------------- written using XML file

@+id/publish_starlist_achieve_btn "android:id="
300dp "android:layout_width="
44dp "android:layout_height="
True "android:layout_centerInParent="
Bottom "android:layout_gravity="
10dp "android:layout_margin="
@drawable/common_btn_selector "android:background="
Android:text= release"
#FFFFFF "android:textColor="
Android:textSize= "16sp" / >

------------------------------common_btn_selector BTN selector, Android:state_enabled enabled, the corresponding drawable different. I

<? Version= encoding= "1" XML "UTF-8" >
Xmlns:android= <selector "" >

<item android:drawable= "@drawable/common_btn_normal" android:state_enabled= "false" / >
<item android:drawable= "@drawable/common_btn_press" android:state_pressed= "true" / >
<item android:drawable= "@drawable/common_btn_normal" / >


In this case, in the millet 3, millet 4, and other mainstream mobile phone shows no problem, but inCool 8297D and other models on the release of the 2 words is not full, then the layout of the layout of the Button layout 0dp android:padding=, the problem is solved.

Copyright statement: This article is the original article of the main Bo, without the permission of the owner.

Guess what you're looking for.
View comments
* above the user's comments only represent their personal views, do not represent the views or position of the CSDN website
    Personal data
    • Visit36043 times
    • Integral:1740
    • Grade
    • Rank:13010th
    • Original144
    • Reprint:36
    • Translation:1
    • Comment:9
    Latest comments