是否可以在android中以矩形以外的其他形状显示Toast?

是否可以在android中以矩形以外的其他形状显示Toast?,android,Android,我想知道除了长方形外,还有没有其他形状的吐司?如果可能的话,我希望能够以如下所示的形状显示我的吐司。我已经找过了,但什么也没找到,任何帮助都将不胜感激 提前谢谢 是的。这是可能的。在“肋吐司”下查看本指南 是的。这是可能的。在“肋吐司”下查看本指南 是的,有可能: custom_toast.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id

我想知道除了长方形外,还有没有其他形状的吐司?如果可能的话,我希望能够以如下所示的形状显示我的吐司。我已经找过了,但什么也没找到,任何帮助都将不胜感激

提前谢谢


是的。这是可能的。在“肋吐司”下查看本指南


是的。这是可能的。在“肋吐司”下查看本指南

是的,有可能:

custom_toast.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/toast_layout"
              android:orientation="horizontal"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content">
    <ImageView 
               android:src="@drawable/yourimage"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"

               />
    <TextView android:id="@+id/text"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textColor="#FFF"
              />
</LinearLayout>
是的,有可能:

custom_toast.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/toast_layout"
              android:orientation="horizontal"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content">
    <ImageView 
               android:src="@drawable/yourimage"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"

               />
    <TextView android:id="@+id/text"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textColor="#FFF"
              />
</LinearLayout>

是的,你可以。以下是一个例子:

custom_toast.xml

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/toast_layout_root"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="8dp"
    android:background="#DAAA">

    <ImageView
        android:src="@drawable/droid"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginRight="8dp" />

    <TextView
        android:id="@+id/text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#FFF" />

</LinearLayout>
更多信息:
是的,你可以。以下是一个例子:

custom_toast.xml

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/toast_layout_root"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="8dp"
    android:background="#DAAA">

    <ImageView
        android:src="@drawable/droid"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginRight="8dp" />

    <TextView
        android:id="@+id/text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#FFF" />

</LinearLayout>
更多信息:

你一直在努力寻找吗?你有多努力寻找的可能重复?可能重复的