Question

i wish to adjust icons in my application that i'm about to devolp.

this is the link of the tutorial that i'm folowing . "https://www.youtube.com/watch?v=lkadcYQ6SuY"

this is the example given and created in the tutorial .

now i don't have the reputation yet to post pictures to show you what i want BUT

simple i want arrows for back and forward (custom created) instead of textbuttons

anyone who can help me ... ?

Was it helpful?

Solution

You can use ImageButton, put your icon into drawable folder(if it doesnt exist, create it), and set it to your imageButton

<ImageButton
    android:id="@+id/imageButton1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/yourImgName" />

OTHER TIPS

You can create a simple Button and set its Background for picture.

    <Button
        android:id="@+id/button"
        android:background="@drawable/help"
        android:contentDescription="@string/help"
        android:gravity="bottom"
        android:onClick="showHelp" />

Or you can create ImageButton :

<ImageButton
        android:id="@+id/sync"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right|center_vertical"
        android:contentDescription="@string/sync"
        android:background="@android:color/transparent"            
        android:src="@drawable/sync" />

try the below code

  <ImageButton
    android:id="@+id/imageButton1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/your_image_name"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top