• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Button Not coming in Center

 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using the following layout..... but after long try , i am unable to center the button... Could anyone please let me know the mistake i am doing here.....

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/softkeyview" android:layout_width="match_parent"
android:layout_height="59.33dp" android:paddingLeft="3.33dp"
android:paddingTop="6.67dp" android:paddingRight="3.33dp"
android:weightSum="2" android:paddingBottom="2.67dp"
android:background="@drawable/winset_softkey_bg">

<Button android:layout_height="wrap_content" android:ellipsize="marquee"
android:layout_width="wrap_content" android:layout_weight="1"
android:singleLine="true" android:textSize="16dp" android:gravity="center"
android:id="@+id/softkeyleft" />

</LinearLayout>
 
Ranch Hand
Posts: 51
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi !


Maybe you should try put the button in the tableRow and set the gravit of tableRow to center_horizontal
Bye .. sorry for my english !! Im still learning !
 
Przemek Boryka
Ranch Hand
Posts: 51
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi again

Try with this:



I think it should help you
 
Sahil Reddy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot , first one worked :-)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic