sir i want to set the height of edittext in string.xml file

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

sir i want to set the height of edittext in string.xml file

Postby hiteshrao » Thu May 22, 2008 8:15 pm

hi
i want to create the edittext for my login and sign up form and i want to set the heght as 30 px constant in string.xml file
how can i do it
hiteshrao
Freshman
Freshman
 
Posts: 9
Joined: Thu May 22, 2008 7:49 pm

Top

Postby plusminus » Thu May 22, 2008 9:19 pm

Hello hitesharo,

I'm not sure what you exactly want to do, but defining the height of views is done in the Layout-Resources.
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.         <TextView
  2.  
  3.         style="@style/settings_quickinfo_textstyle"
  4.  
  5.         android:layout_width="wrap_content"
  6.  
  7.         android:layout_height="30px"  <!-- here -->
  8.  
  9.         android:text="Hello World"  />
Parsed in 0.001 seconds, using GeSHi 1.0.8.4

Setting [font=Courier New]android:layout_height[/font] to an exact pixel-value is said to be 'executed' pixel-sharp, but this maybe conflicts with TextSizes. :? ( I haven't tried that)

Or do you want to extract that "30px" to a separate resource-file.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby cadlg » Thu May 22, 2008 10:09 pm

I think that's what he wants, plusminus.

If that's the case, you can define the layout_height (and other parameters) in a styles file.

styles.xml (res-values):
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <resources>
  2.  
  3.     <style name="LoginText">
  4.  
  5.         <item name="android:layout_height">30px</item>
  6.  
  7.         <item name="android:layout_width">fill_parent</item>
  8.  
  9.     </style>
  10.  
  11. </resources>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


and set that style to your TextView in res-layout

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.     <EditText android:id="@+id/login"
  2.  
  3.        style="@style/LoginText"
  4.  
  5.                 ...
  6.  
  7.                 ...
  8.  
  9.    </EditText>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


Regards,

cadlg
cadlg
Experienced Developer
Experienced Developer
 
Posts: 84
Joined: Wed Feb 20, 2008 12:33 am
Location: Guatemala

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests