Search - combine textview with imagebutton


Last Updated:

  1. tanion

    tanion New Member This Topic's Starter

    Joined:
    Aug 19, 2010
    Messages:
    2
    Likes Received:
    0
    Hi! I'm new to this forum and is kind of a n00b when it comes to android development, but very familiar with Oracle Java.

    So i've just begun developing my first app and have a question. How do I combine a TextView with an ImageButton so it looks like one component (in gui)? I dont know what I'm doing wrong but my components still look a 2 separate items. I want it to look like this but it looks as below.

    Here is the code for the layout.

    Code (Text):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <LinearLayout
    3.    xmlns:android="http://schemas.android.com/apk/res/android"
    4.    android:orientation="vertical"
    5.    android:layout_width="fill_parent"
    6.    android:layout_height="fill_parent"
    7.    >
    8.       <LinearLayout
    9.         android:layout_width="fill_parent"
    10.         android:layout_height="wrap_content"
    11.         android:addStatesFromChildren="true"
    12.         android:gravity="center_vertical"
    13.         android:paddingTop="5dip"
    14.         android:paddingLeft="5dip"
    15.         android:paddingRight="5dip"
    16.         android:background="@drawable/search_bg"
    17.         >
    18.        <AutoCompleteTextView
    19.             android:id="@+id/search_text"
    20.             android:hint="S
     

    Attached Files:


    Advertisement
  2. id0001

    id0001 Well-Known Member

    Joined:
    Apr 20, 2010
    Messages:
    142
    Likes Received:
    23
    My guess is that you have to use a custom 9-patch drawable for the imagebutton's background property.
    I don't know if there is a standard drawable available that does that but let me know if you find it. I can use it too :)
     
  3. tanion

    tanion New Member This Topic's Starter

    Joined:
    Aug 19, 2010
    Messages:
    2
    Likes Received:
    0
    I'm not sure but i dont think this has to do with drawables. I havent yet taken care of the actual search. Could this be it?
     

Share This Page

Loading...