Adjust a font border distance today, the results have not been implemented, the layout is as follows
<Relativelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_height= "Match_parent"Android:layout_width= "Match_parent"> <TextViewAndroid:id= "@+id/result_count"style= "@style/unreadcountsearch"Android:layout_alignparentright= "true"Android:textcolor= "#ffffff"
<!--are the size of their own--
Android:textsize= "30SP"Android:layout_marginleft= "4DP" /> <TextViewAndroid:id= "@+id/search_field"Android:layout_height= "Match_parent"Android:layout_width= "100DP"style= "@style/textappearance.editevent_spinner"Android:layout_alignparentleft= "true"android:visibility= "Gone"android:gravity= "Center"Android:layout_marginleft= "4DP" /> <Android.widget.SearchViewAndroid:id= "@+id/email_search_view"android:gravity= "Center_vertical"Android:layout_height= "Match_parent"Android:layout_width= "Match_parent"Android:layout_marginleft= "4DP"Android:hint= "@string/search_hint"Android:maxwidth= "@dimen/search_view_width"Android:layout_torightof= "@+id/search_field"Android:layout_toleftof= "@+id/result_count" /></Relativelayout>
Where the unreadcountsearch layout is as follows
<stylename= "Unreadcountsearch"> <Itemname= "Android:layout_width">Wrap_content</Item> <Itemname= "Android:layout_height">Wrap_content</Item> <Itemname= "Android:layout_centervertical">True</Item> <Itemname= "Android:layout_marginleft">8dip</Item> <Itemname= "Android:layout_marginright">8dp</Item> <Itemname= "Android:includefontpadding">False</Item> <Itemname= "Android:singleline">True</Item> <Itemname= "Android:gravity">Right</Item> <Itemname= "Android:textsize">36sp</Item> <Itemname= "Android:textcolor">#33b5e5</Item> </style>
Try the margin padding is not, because the font distance from the length of the border will never change, if you adjust the following bottom property, the font will appear below the problem. Finally found the problem.
Reason:
The original font is too large, naturally there will be the length of the distance frame, this length is related to the size of the font, change the font size is good
Android-textview cannot adjust the distance between fonts and borders