android - resize icons...

I have a jellybean holder and thats just a graphic and I need to sit an imagebutton on top...but im not sure how to do that...also I have a it possibel to resize it in the android XML code?
LVL 10
Who is Participating?
You can set an ImageButton on top of your jellybean holder. A solution to the similar isue could be seen at
PFA code snippet from the referred website.

Regarding resizing, it can be done through the XML code in android. You will have to use properties like android:layout_width, android:layout_height.
Also, you may use properties like android:paddingLeft, android:paddingRight to set the view as desired.
<FrameLayout xmlns:android=""    android:layout_width="fill_parent"    android:layout_height="fill_parent">    <ImageView          android:layout_width="fill_parent"         android:layout_height="fill_parent"             android:scaleType="center"        android:src="@drawable/golden_gate" />        <TextView        android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_marginBottom="20dip"        android:layout_gravity="center_horizontal|bottom"        android:padding="12dip"                android:background="#AA000000"        android:textColor="#ffffffff"                android:text="Golden Gate" /></FrameLayout>

Open in new window

GlobaLevelProgrammerAuthor Commented:
thanks for the response...I actually am using relative layout because I have an image that is to big and I need to shrink it down..and center in the middle of the screen...but I cant reduce it...but when I alter via the relative layout, you can only see a portion of the image...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.