1. Download our Official Android App: Forums for Android!

Apps Search - combine textview with imagebutton

Discussion in 'Android Development' started by tanion, Oct 8, 2010.

  1. tanion

    tanion Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Aug 19, 2010

    Aug 19, 2010
    2
    0
    5
    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
    Rank:
    None
    Points:
    38
    Posts:
    142
    Joined:
    Apr 20, 2010

    Apr 20, 2010
    142
    23
    38
    Student.. also software developer
    Netherlands
    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 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Aug 19, 2010

    Aug 19, 2010
    2
    0
    5
    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...