无法设置文字大小使用FlowTextView - 的Java / Android版/ XML [英] Unable to Set Text Size Using FlowTextView - Java / Android / XML

查看:115
本文介绍了无法设置文字大小使用FlowTextView - 的Java / Android版/ XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了一个库,它允许应用环绕图片文字 - 但是一旦实施它改变了我的文字的大小 - 如何使用这个库时,文字大小可以增加?

的android:TEXTSIZE = 对文字的大小没有任何影响

确实也不:

  FlowTextView titleTv =(FlowTextView)findViewById(R.id.titleTv);
((FlowTextView)findViewById(R.id.titleTv))setTextSize(20)。

的https://$c$c.google.com/p/android -flowtextview /

示例:

 < com.pagesuite.flowtext.FlowTextView
        机器人:ID =@ + ID / titleTv
        机器人:layout_width =FILL_PARENT
        机器人:layout_height =WRAP_CONTENT
        机器人:paddingLeft =5DP
        机器人:文字=
        机器人:TEXTSIZE =20SP>


解决方案

在短期内调用无效可能会得到它的工作:

  FlowTextView titleTv =(FlowTextView)findViewById(R.id.titleTv);
titleTv.setTextSize(20);
titleTv.invalidate();

不过,我怀疑您正在使用的jar文件吗?这是很过时了,所以我会建议您检查源$ C ​​$ C,并在使用它作为一个Android库项目 - setTextSize()应该正常工作,那么无需调用无效()(加上其他各种错误修正等)

此外 - 我从来不添加通过XML设置文字大小的能力 - 也不会太难添加这个虽然。

I found a library which allows an app to wrap text around an image - however once implemented it changed the size of my text - how can the text size be increase when using this library?

android:textSize= has no impact on the text size.

Neither does:

 FlowTextView titleTv = (FlowTextView) findViewById(R.id.titleTv);
((FlowTextView) findViewById(R.id.titleTv)).setTextSize(20);

https://code.google.com/p/android-flowtextview/

Example:

   <com.pagesuite.flowtext.FlowTextView
        android:id="@+id/titleTv"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="5dp"
        android:text=""
        android:textSize="20sp" >

解决方案

In the short term a call to invalidate will probably get it working:

FlowTextView titleTv = (FlowTextView) findViewById(R.id.titleTv);
titleTv.setTextSize(20);
titleTv.invalidate();

However, I suspect you are using the JAR file right? It is quite out of date so I would recommend checking the source code out and using it as an android library project - setTextSize() should work properly then without needing a call to invalidate() (plus various other bug fixes etc).

Also - I never added the ability to set the text size via XML - wouldn't be too hard to add this though.

这篇关于无法设置文字大小使用FlowTextView - 的Java / Android版/ XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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