Alignment missing in android multiplescreen style -


the below style wrote in values>style.xml

<style name="phoneletters">     <item name="android:textsize">12sp</item>     <item name="android:layout_marginleft">5dp</item>     <item name="android:gravity">center</item> </style> 

i have added textsize 12sp 22sp bigger appearance in tablet - values-sw600dp>style.xml

<style name="phoneletters">     <item name="android:textsize">22sp</item> </style> 

above styles marginleft , garvity missed in tablet. should duplicate above styles here tablet styles also?

you can have style duplicate there no problems, must add in different folder in res different screen resolutions.

for example if have style this:

<style name="phoneletters">     <item name="android:textsize">12sp</item>     <item name="android:layout_marginleft">5dp</item>     <item name="android:gravity">center</item> </style> 

you need create styles.xml whit code above in:

  • values

  • values-small

  • values-small-portrait
  • values-small-landscape

  • values-normal

  • values-normal-portrait
  • values-nomral-landscape

  • values-large

  • values-large-portrait
  • values-large-landscape

  • values-xlarge

  • values-xlarge-portrait
  • values-xlarge-landscape

after add styles change example text size 12sp small set 12sp , normal set 16sp large put 20sp , see difference device whitout doing anything. textsize smaller on smartphones , bigger on tablet.

hope help.

cheers,


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -