ImageButton coming out small. Java-Android Devleopment -


having problem! have made image buttons in xml using relative layout. ok when i've made them when run on phone comes out small! want expand width of device (or width of device goes to)

here's xml:

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" >  <imagebutton     android:id="@+id/prewedbutton"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_alignleft="@+id/weddingbutton"     android:layout_alignparenttop="true"     android:layout_margintop="90dp"     android:contentdescription="@drawable/prewedbutton"     android:src="@drawable/prewedbutton" />  <imagebutton     android:id="@+id/weddingbutton"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_alignparentbottom="true"     android:layout_centerhorizontal="true"     android:layout_marginbottom="103dp"     android:contentdescription="@drawable/weddingbutton"     android:src="@drawable/weddingbutton" />  </relativelayout> 

and here java:

package com.example.ijazphotography;  import android.os.bundle; import android.app.activity; import android.view.view; import android.view.view.onclicklistener; import android.widget.imagebutton; import android.content.intent;  public class photographyactivity extends activity {  @override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_photography);     // show button in action bar.          imagebutton prewed = (imagebutton) findviewbyid(r.id.prewedbutton);         prewed.setonclicklistener(new onclicklistener() {          public void onclick(view v) {                 intent intent = new intent(v.getcontext(), prewedactivity.class);                 startactivityforresult(intent, 0);              }         });          imagebutton wed = (imagebutton) findviewbyid(r.id.weddingbutton);         wed.setonclicklistener(new onclicklistener() {          public void onclick(view v) {                 intent intent = new intent(v.getcontext(), wedding.class);                 startactivityforresult(intent, 0);              }         });      }   } 

sorry pain again, helpful!

thank in advance!

try android:layout_width="fill_parent" , android:scaletype="fitxy" , , tell me results please.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -