setTextAppearance(), does not work?

Put your problem here if it does not fit any of the other categories.

setTextAppearance(), does not work?

Postby Jesmiatka » Tue Mar 04, 2008 10:11 am

Hi guys,

I've been trying to use the setTextAppearance function for making the text in a custom made list bold.
I tried to set the text appearance when I create the views, but this didn't work..
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                 mVar1 = new TextView(context);
  2.  
  3.                 mVar1.setText(aIssueItem.getVar1());
  4.  
  5.                 mVar1.setTextAppereance(getContext(), android.R.id.bold);
  6.  
  7.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


also tried getting the context of mVar1.. but didn't work either
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                 mVar1 = new TextView(context);
  2.  
  3.                 mVar1.setText(aIssueItem.getVar1());
  4.  
  5.                 mVar1.setTextAppereance(mVar1.getContext(), android.R.id.bold);
  6.  
  7.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


am I approaching the setTextAppearance in the wrong way?
Jesmiatka
Senior Developer
Senior Developer
 
Posts: 164
Joined: Mon Feb 04, 2008 3:37 pm
Location: Netherlands

Top

Postby res » Tue Mar 04, 2008 4:26 pm

setTextAppearance was sure hard to find in the docs, if you use the search bar on http://code.google.com/android/ nothing comes up and using Android setTextAppearance from google.com showed nothing either. But if you include the () at the end it shows up, quite annoying.

How have you setup your TextAppearance resource?
res
Senior Developer
Senior Developer
 
Posts: 146
Joined: Tue Nov 20, 2007 8:14 pm
Location: United States

Postby bAZtARd » Wed Apr 09, 2008 11:20 am

Hi guys!
I got similiar problems

the following code:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. TextView tv = new TextView(ctx);
  2.  
  3.                 tv.setText(text);
  4.  
  5.                 tv.setTextAppearance(ctx, android.R.attr.textAppearanceLargeInverse);
  6.  
  7.                
Parsed in 0.034 seconds, using GeSHi 1.0.8.4

does not have any influence on the text at all....what am i doing wrong? or is this just the buggyness of the SDK?


I'm trying to create a UI entirely without using XML files. i want to create it dynamically. hope that is possible and you got the same functionality by either using xml or not...are there any experiences?

Have you guys yet found a solution?
bAZtARd
Freshman
Freshman
 
Posts: 8
Joined: Wed Apr 09, 2008 11:03 am

Postby Steel » Fri Apr 11, 2008 7:28 pm

This one works:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.     TextView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
Steel
Developer
Developer
 
Posts: 48
Joined: Fri Dec 28, 2007 1:11 pm
Location: Herning, Denmark

Postby bennyb » Wed Dec 02, 2009 5:23 pm

Steel wrote:This one works:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.     TextView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
Parsed in 0.035 seconds, using GeSHi 1.0.8.4


Nonesense

textView.setTextAppearance(this,android.R.attr.listSeparatorTextViewStyle); DOES NOT WORK
bennyb
Junior Developer
Junior Developer
 
Posts: 13
Joined: Wed Sep 23, 2009 4:45 pm

Postby B_Thax » Sun May 02, 2010 6:27 pm

bennyb wrote:
Steel wrote:This one works:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.     TextView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
Parsed in 0.035 seconds, using GeSHi 1.0.8.4


Nonesense

textView.setTextAppearance(this,android.R.attr.listSeparatorTextViewStyle); DOES NOT WORK


It's not nonsense, it works for me at least!
Game Programmer at Tragnarion Studios - www.Tragnarion.com
User avatar
B_Thax
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Jul 17, 2008 5:55 pm
Location: Palma de Mallorca

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 14 guests