How to set a button in center bottom in Android XML Linear Layout? -


i'm trying put button on center & bottom of linear layout. used below codes, & it's not working. can u guys me out?

<button             android:id="@+id/button1"             android:layout_width="fill_parent"             android:layout_height="wrap_content"             android:layout_margintop="20dp"             android:layout_gravity="center|bottom"             android:background="#c01831"             android:onclick="meonfb"             android:textcolor="#ffffff"             android:layout_alignparentbottom="true"             android:text="talk developer" /> 

and mother layout is,

 <linearlayout         android:layout_width="match_parent"         android:layout_height="fill_parent"         android:layout_margin="12dp"         android:background="#f9f9f9"         android:orientation="vertical"         android:padding="10dp" >  </linearlayout> 

below code place button center-bottom in layout.

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="fill_parent"     android:layout_margin="12dp"     android:background="#f9f9f9"     android:orientation="vertical"     android:padding="10dp"     android:gravity="bottom|center">      <button         android:id="@+id/button1"         android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:layout_margintop="20dp"         android:layout_gravity="center|bottom"         android:background="#c01831"         android:onclick="meonfb"         android:textcolor="#ffffff"         android:layout_alignparentbottom="true"         android:text="talk developer" />  </linearlayout> 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -