java - How can i place two buttons side by side with an image at the bottom of the button? -


how can place 2 buttons side side image @ bottom of button?

<linearlayout     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:orientation="horizontal" > <button     android:id="@+id/a_button"     android:layout_width="wrap_content"     android:layout_height="35dp"     android:text="button-a" /> <button     android:id="@+id/b_button"     android:layout_width="wrap_content"     android:layout_height="35dp"     android:text="button-b" />   </linearlayout> 

instead of using button u can use linear-layout(clickable) , use id instead of button id.something this...... using can customize button per requirements.

<linearlayout     android:layout_width="match_parent"     android:layout_height="50dp"     android:orientation="horizontal" > 

//button-a

    <linearlayout         android:id="@+id/a_button"         android:layout_width="0dp"         android:layout_height="fill_parent"         android:layout_weight="0.50"         android:orientation="vertical"      android:clickable="true">          <textview             android:layout_width="fill_parent"             android:layout_height="wrap_content"             android:gravity="center_horizontal|center_vertical"             android:text="text-a"             android:paddingtop="10dip"              />          <imageview             android:layout_width="fill_parent"             android:layout_height="wrap_content"             android:scaletype="fitxy"             android:src="@drawable/image_a"             android:paddingtop="13dip"  />      </linearlayout> 

//for horizontal partition line

     <textview         android:layout_width="2dp"         android:layout_height="fill_parent"         android:background="#303030"         android:paddingtop="20dip" /> 

//button-b

     <linearlayout           android:id="@+id/b_button"          android:layout_width="0dp"          android:layout_height="fill_parent"          android:layout_weight="0.50"          android:orientation="vertical"       android:clickable="true">           <textview             android:layout_width="fill_parent"             android:layout_height="wrap_content"             android:text="text-b"             android:gravity="center_horizontal|center_vertical"             android:paddingtop="10dip" />          <imageview              android:layout_width="fill_parent"              android:layout_height="wrap_content"              android:scaletype="fitxy"              android:src="@drawable/image_b"              android:paddingtop="13dip"               />      </linearlayout> </linearlayout> 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -