Comments (9)
Other try with Spannable in PixlUI sample:
TextView mBox = (TextView) findViewById(R.id.textView1); Spannable word = new SpannableString("Your message"); word.setSpan(new ForegroundColorSpan(Color.BLUE), 0, word.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); mBox.setText(word); Spannable word1 = new SpannableString("Your new message"); word1.setSpan(new ForegroundColorSpan(Color.RED), 0, word1.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); mBox.append(word1);
And it's showing this:
from pixlui.
Do you use Spannable ? Html.fromHtml?
from pixlui.
I've tested both of them and neither has worked for me.
Using spanable or html worked for me only with android default textview (same come, same example)
---- Mensaje original ---
De: "@odemolliens" [email protected]
Enviado: 7 de mayo de 2014 5:57 a.m.
Para: "neopixl/PixlUI" [email protected]
Cc: "edriang" [email protected]
Asunto: Re: [PixlUI] Single TextView with two or more colors (#9)
Do you use Spannable ? Html.fromHtml?
Reply to this email directly or view it on GitHub:
#9 (comment)
from pixlui.
I have try this in the PixlUI in the sample
TextView mBox = (TextView) findViewById(R.id.textView1);
mBox.setText(Html.fromHtml("<b>" + "lol" + "</b>" + "<br />" + "<small><font color=\"red\">" + "test" + "</font></small>" + "<br />" + "<small><font color=\"blue\">" + "test" + "</small></font>"));
And it's showing this:
So where is the problem?
from pixlui.
On one line (with Html.fromHtml)
from pixlui.
I close if I got no news. It's seems working !!!
from pixlui.
Hi, I'm applying style in this way and doesn't work with pixl's TextView, but works OK setting the font manually in TextView from code:
//String pad = "000";
//String score = "23";
Spannable padString = new SpannableString(pad);
padString.setSpan(new ForegroundColorSpan(0x80FFFFFF), 0, pad.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
Spannable scoreString = new SpannableString(score);
scoreString.setSpan(new ForegroundColorSpan(0xFFFFFFFF), 0, score.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
textView.setText(padString);
textView.append(scoreString);
from pixlui.
I'm using the .jar 1.0.5 downloaded from here: https://github.com/neopixl/PixlUI/releases
from pixlui.
I just ran into this as well - doesn't work with Pixlui - either Html.fromHtml or Spannable. Changing to regular android.widget.TextView makes it work as expected.
from pixlui.
Related Issues (20)
- Overlapped smileys in EditText
- Justified Text Style HOT 3
- Ellipsizing HOT 8
- Styles HOT 5
- Flow uses PixlUI HOT 6
- Using string resource as typeface HOT 4
- font size HOT 2
- text spacing
- adapt the new lib HOT 3
- jitpack issue HOT 11
- module library wrapping HOT 3
- Project unavailable on jitpack.io HOT 2
- line spacing
- are there anyways to change the line height?
- Changelog in README needs updating
- Fonts don't get selected HOT 4
- EditText side effect with android:inputType="textPassword"
- np.EditText cannot be instantiated
- Memory Leak: Activity Leak on PixlUIfaceManager.INSTANCE HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixlui.