当布局高度很高时,Android 圆角形状不起作用?

问题描述

当 textView 的高度非常高时,线性布局中的左上圆角形状无法正常工作。即使高度仅占屏幕的 50%,当高度较高时,左上角也会变成矩形。

这是为什么以及如何解决这个问题?

 <LinearLayout
      android:id="@+id/message_my"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" android:padding="0dp"
      android:layout_marginLeft="6dp"  android:layout_marginRight="0dp"
      android:layout_marginTop="0dp"    android:layout_marginBottom="0dp"
      android:orientation="vertical"
      android:layout_gravity="right"  android:background="@drawable/shape_right" >          
      <TextView
         android:id="@+id/message_my_text"
         android:layout_width="wrap_content"     android:maxWidth="250dp"
         android:layout_height="wrap_content"
         android:layout_marginLeft="4dp"        android:layout_marginStart="4dp"
         android:layout_marginRight="4dp"      android:layout_marginEnd="4dp"
         android:paddingLeft="10dp"  android:paddingRight="22dp"  
         android:paddingTop="6dp"  android:paddingBottom="6dp"
         android:textAppearance="@style/sn_message"   android:textColor="@null"
         android:text="message left-top rounded corner is not working when height is very big. ??? xxxx xx ?????  Among the natural objects which exerted this potent sway over the poetry of Burns,the streams of Ayrshire and NithsDale ever held a foremost place. Their banks were his favourite haunt for reverie. They were familiar to him under every change of sky and season,from firth to fell. Each feature in their seaward course was noted by his quick eye,and treasured in his loving memory. Their union of ruggedness and verdure,of sombre woods and open haughs,of dark cliff and bright meadow,of brawling current and stealthy flow,furnished that variety which captivated his fancy,and found such fitting transposition to his verse."/>
 </LinearLayout>

shape_right.xml :

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <rotate
            android:fromdegrees="45"
            android:pivotX="100%"
            android:pivotY="0%" >
            <shape android:shape="rectangle">
                <solid android:color="@color/green" />
            </shape>
        </rotate>
    </item>
    <item android:right="12dp">
        <shape
            android:shape="rectangle">
            <solid android:color="@color/green"/>
            <corners
                android:bottomLefTradius="15dp"
                android:bottomrighTradius="15dp"
                android:topLefTradius="15dp"
                android:topRighTradius="5dp" />
        </shape>
    </item>
</layer-list>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...