Android Button Hint

iOS implemenatation

I'm new to Android, and I was wondering if there is an Android button element with a built-in tooltip? I would like to have an image on the button that when clicked, the / tootip overlay dialog box opens. So it’s not a tooltip, but a clickable element that is located somewhere, except where the button is pressed. If someone could direct me to the best practice for this, that would be great!

<LinearLayout android:orientation="vertical"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:gravity="center" 
    android:paddingLeft="5dip" 
    android:paddingRight="5dip">

    <Button android:id="@+id/settings_predefined_message_btn"
        android:layout_width="fill_parent"  
        android:layout_height="wrap_content"
        android:text="@string/settings_predefined_messages"
        android:background="@drawable/selector_longbutton_witharrow" 
        style="@style/ButtonTextStyle"
        android:layout_marginTop="10dip" 
        android:gravity="center" />
+3
source share
1 answer

(In response to your last comment about setting to view on top of another.)

Simple, you can use several LinearLayouts, for example:

<LinearLayout
    android:id="@+id/tab1"
    ... />

    <TextView
        android:text="Predefined Message"
        ... />

    <ImageButton
        ... />

</LinearLayout>

LinearLayout (, , TextView) OnClickListener , ImageButton OnClickListener .

RelativeLayout, ImageButton OnClickListener TextView OnClickListener.

ActionBar, , . , .

An (!) RelativeLayout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    >

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="A long text sample"
        />

    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignRight="@+id/button1"
        android:layout_marginRight="10dp"
        android:text="i"
        />

</RelativeLayout>
+1

All Articles