简体   繁体   English

Android TextView不需要的填充问题

[英]Android TextView unwanted padding issue

不需要的右侧填充

I am having issue with android TextView. 我在使用Android TextView时遇到问题。 having unwanted spacein TextView, the space is coming only sometimes. 在TextView中有多余的空间时,仅有时会出现空间。 For your reference attached image above, you can see some extra space on the right end of TextView. 对于上面的参考图像,您可以在TextView的右端看到一些额外的空间。 Please help me guys. 请帮助我。 here is the xml code 这是XML代码

  <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:autoLink="all"
                android:ellipsize="end"
                android:padding="0dp"                     
                android:gravity="start"
                android:text="@{message.message}"
                android:textColor="@android:color/white"
                android:textColorLink="@android:color/white"
                android:textIsSelectable="true"
                android:textSize="14sp"
                tools:text="this is the  problem i am having please helpme to find a solution" />

you can use this library to justify textview 您可以使用该库来证明textview合理性

https://github.com/navabi/JustifiedTextView https://github.com/navabi/JustifiedTextView

 <ir.noghteh.JustifiedTextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="right"
    android:padding="25dp"
    xmlns:noghteh="http://noghteh.ir"
    noghteh:text="text here"
    noghteh:textColor="@color/text"
    noghteh:textSize="18sp"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM