I'm a C# programmer, not Android, so this may be idiotic to a real Android
programmer; but...
 
I have projects which all have 4 folders for Values that each contain a
different Styles.xml file.
 
Resources/Values-xlarge
Resources/Values-large
Resources/Values-normal
Resources/Values-small
 
Each Styles.xml has entries like...
 
<style name="NormText">

<item name="android:textSize">16sp</item>

</style>

<style name="NormBtn">

<item name="android:textSize">18sp</item>

<item name="android:layout_height">wrap_content</item>

</style>

This way I only need one Layout that references the style from the
appropriate folder based on size.
 
<Button

android:id="@+id/startBtn"

style="@style/NormBtn"

android:layout_width="fill_parent"

android:text="Start Location Service"

/>

 
Steve Sharrock
Architecture/Design/Programming
www.sharkcode.com <blocked::http://www.sharkcode.com/> 
 

  _____  

From: monodroid-boun...@lists.ximian.com
[mailto:monodroid-boun...@lists.ximian.com] On Behalf Of Goncalo Oliveira
Sent: Thursday, August 16, 2012 10:09 AM
To: Discussions related to Mono for Android
Subject: [mono-android] Screen sizes and layouts


Hi there,

The application I'm developing needs to support several different sizes,
from Normal to Extra Large. I'm using sp for text size and dp for everything
else, as recommended in android's best practices. The thing is... In many
places the only thing that changes is the text size, and I really need to
set a different size for each screen layout - unless I'm mistaken. This is
kind of awful as I'll have to have layouts for every screen size, in some
cases multiplied by orientation. So my question here is... isn't there some
other way (easier one) for doing this?

I've looked at the text appearance flags, like
?android:attr/textAppearanceMedium but they look completely different across
sizes, so that isn't good enough either.
I know this is not exactly Xamarin related, but Android, though... I'd
appreciate some hints on "the best way" of doing this.

Cheers

-- 
Gonçalo Oliveira

_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to