Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

test: Reply
 
LinkBack Thread Tools
Old January 31st, 2013, 12:47 PM   #1 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Nov 2010
Posts: 70
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default how setup the font size of text in a Button

how setup the font size of text in a
HTML Code:
<?xml version="1.0" encoding="UTF-8"?>
<Button xmlns:android="http://schemas.android.com/apk/res/android"
   android:id="@+id/newGuessButton" android:layout_weight="1"
   android:layout_width="wrap_content" 
   android:layout_height="wrap_content"></Button>

Advertisements
lse123 is offline  
Reply With Quote
sponsored links
Old January 31st, 2013, 01:22 PM   #2 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

add
Code:
android:fontSize="10sp"
to your button xml, where 10sp can be w/e size you want.
__________________
My blog, Inverted Keystrokes, is looking for aspiring developers (not necessarily with Android) to post articles. If you have any development experience and are interested in participating, please PM me. =)
jonbonazza is offline  
Reply With Quote
Old January 31st, 2013, 01:49 PM   #3 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Nov 2010
Posts: 70
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

MY APP FILES - all assets are the most 8MB - But apk reach 30MB any way reduce?

AdMob ADs require Google API to compile or Android API is ok?

posted here this latter thread

AdMob ADs require Google API to compile or Android API is ok
lse123 is offline  
Last edited by lse123; January 31st, 2013 at 02:46 PM.
Reply With Quote
Old February 1st, 2013, 03:14 AM   #4 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Nov 2010
Posts: 70
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

what about setting font properties and particularly size of button font, from java?
lse123 is offline  
Reply With Quote
Old February 1st, 2013, 03:33 AM   #5 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Nov 2010
Posts: 70
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

newGuessButton.setTextSize(10); used this success... what 10 is measured for in this case???
lse123 is offline  
Reply With Quote
Old February 1st, 2013, 02:33 PM   #6 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

See here:
TextView | Android Developers, float)
jonbonazza is offline  
Reply With Quote
Old February 2nd, 2013, 12:49 AM   #7 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Nov 2010
Posts: 70
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

void setTextSize(float size)
Set the default text size to the given value, interpreted as "scaled pixel" units.
void setTextSize(int unit, float size)
Set the default text size to a given unit and value.

yes i saw but DEFAULT is sp units? if set a unit i supposed to use
void setTextSize(COMPLEX_UNIT_PX, 10)
void setTextSize(COMPLEX_UNIT_SP, 10)
lse123 is offline  
Reply With Quote
Old February 2nd, 2013, 02:38 AM   #8 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Nov 2010
Posts: 70
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

also what's the default size if the command missing in xml and also missing in java?
lse123 is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:08 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.