2016-07-04 12 views
0

Ich versuche 3 Radiobuttons mit Bild auf ihnen zu bilden. Also habe ich das XML-Attribut android:button verwendet. Aber da meine Bildgröße zu groß ist, kann ich nicht sehen, dass sie in den Knopf passt.Wie verkleinert man die Größe eines Bildes auf einem RadioButton auf eine gewünschte Größe in Android?

Es folgt mein XML-Code:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/netbankingRoot" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:padding="10dp" 
    android:layout_marginTop="50dp" 
    android:layout_marginLeft="5dp" 
    android:layout_marginRight="5dp" 
    tools:context=".activities.fragments.NetBankingFragment"> 


    <TableLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:id="@+id/listOfBanks" 
     android:padding="20dp" 
     android:layout_marginLeft="60dp"> 

     <TableRow 
      android:layout_marginBottom="5dp"> 
      <RadioButton 
       android:layout_height="60dp" 
       android:layout_width="60dp" 
       android:id="@+id/sbi" 
       android:text="SBI" 
       android:padding="30dp" 
       android:button="@drawable/sbilogo" 
       android:layout_marginRight="20dp"/> 


      <RadioButton 
       android:layout_height="wrap_content" 
       android:layout_width="wrap_content" 
       android:id="@+id/axis" 
       android:text="AXIS" 
       android:padding="10dp"/> 

     </TableRow> 

     <TableRow 
      android:layout_marginBottom="5dp"> 

      <RadioButton 
       android:layout_height="wrap_content" 
       android:layout_width="wrap_content" 
       android:id="@+id/citi" 
       android:text="CITI" 
       android:padding="10dp"/> 

     </TableRow> 




    </TableLayout> 
</ScrollView> 

Was ich hier ist immer this. Was ich hier zu bekommen versuche, ist this

Vielen Dank für Ihre Zeit!

Antwort

0

Ich glaube, Sie haben das Bild klein zu machen, indem ein anderes Bildbearbeitungswerkzeug als „Paint.net“

+0

Ist das der einzige Weg ?? – Auro

+0

ich muss auch so verwenden ... nach langer Suche habe ich auch nur diesen Weg gefunden .. – jaunvi

+0

Versucht .. Hat nicht funktioniert. Wissen Sie, ob ein ImageButton in Android als RadioButton verwendet werden kann? – Auro

Verwandte Themen