大佬教程收集整理的这篇文章主要介绍了如何解决圆形矩形太大而无法在android TextBox中渲染为纹理,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<shape xmlns:android="http://scheR_317_11845@as.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#800e1520" android:endColor="#801e252f" android:angle="45"/> <padding android:left="7dp" android:top="7dp" android:right="7dp" android:bottom="7dp" /> <corners android:radius="8dp" />
我的textview是:
<TextView android:id="@+id/textView1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layouT_Below="@+id/rel1" android:layout_centerHorizontal="true" android:layout_marginTop="8dp" android:BACkground="@drawable/rounded_corners" android:gravity="right" android:linespacingExtra="6dp" android:supportsRtl="true" android:text="@String/Hello_world" android:textColor="#FFFFFF" />
当文字像这样短
但是当文字太大而没有显示背景和eclipse的logcat显示时
Shape round rect too large to be rendered into a texture (424x5884,max=2048x2048)
怎么解决?
谢谢
如果你需要做成绩等,那么看看Shader’s,https://developer.android.com/reference/android/graphics/LinearGradient.html
应该做你需要的.
/** * Created by chris on 04/11/2013 */ public class WidgetLinearLayout extends LinearLayout { //Dither and smooth :) private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG); private final RectF mBound = new RectF(); private final float radius; public WidgetLinearLayout(Context context) { this(context,null); } public WidgetLinearLayout(Context context,AttributeSet attrs,int defStylE) { this(context,attrs); } public WidgetLinearLayout(Context context,AttributeSet attrs) { super(context,attrs); setBACkgroundDrawable(null); mPaint.setColor(getresources().getColor(R.color.whitE)); mPaint.setStyle(Paint.Style.FILL); radius = getresources().getDimension(R.dimen.widget_corner_radius); setWillNotDraw(false); } @Override protected void onLayout(Boolean changed,int l,int t,int r,int b) { super.onLayout(changed,l,t,r,b); mBound.set(l,b); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawRoundRect(mBound,radius,mPaint); } }@H_450_2@ @H_450_2@
以上是大佬教程为你收集整理的如何解决圆形矩形太大而无法在android TextBox中渲染为纹理全部内容,希望文章能够帮你解决如何解决圆形矩形太大而无法在android TextBox中渲染为纹理所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。