TextView中没有任何默认填充,同时增加的TextView的大小 [英] textView without any default padding while increasing size of textView

查看:462
本文介绍了TextView中没有任何默认填充,同时增加的TextView的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想删除默认填充上的TextView。当我增加的TextView的大小,然后它会自动的填充规模的增大。即使我设置的文本显示为@null的背景。我只是想表明没有任何填充只有文字。我的看法是这样的第一印象,我想表现出像第二图像。

I want to remove default padding on textView. when i increase the size of textView then it's padding size increases automatically. even i set background of text View as "@null". i just want to show only text without any padding. my View looks like this first images and i want to show like second images.

第一图片

第二图像

推荐答案

这也许可以帮助您

<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="0dip"
        android:layout_margin="0dip"
        android:background="@android:color/transparent" />

编辑: 试试这个两个属性:

Try this two attributes:

        android:maxWidth="...dip"
        android:maxHeight="...dip"

这篇关于TextView中没有任何默认填充,同时增加的TextView的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆