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 graphic..is it possibel to resize it in the android XML code?
LVL 10
GlobaLevelProgrammerAsked:
Who is Participating?
 
rkpuneCommented:
You can set an ImageButton on top of your jellybean holder. A solution to the similar isue could be seen at http://developer.android.com/resources/articles/layout-tricks-merge.html.
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="http://schemas.android.com/apk/res/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

0
 
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...
0
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.