Android-textview cannot adjust the distance between fonts and borders

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.