2

RomainNurikのライブラリを使用して、元に戻すトーストをユーザーに表示します (Gmail アプリのように)

キットカット以前は、トースト オプションは長方形でしたが、キットカットではトースト メッセージの角が丸くなっていました。トーストの半径を取得する get() メソッドはありますか? ライブラリを使用している場合、 getRadius() を使用して、それに応じてトーストを調整できますか?

注: そうしないと、KitKat の前と KitKat の 2 つの異なる値を指定する必要があります。

ここに画像の説明を入力

4

1 に答える 1

2

おそらく、あなたが望むのはレイアウトファイルにandroid:shadowRadiusあるトーストです。2.75

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="?android:attr/toastFrameBackground">

    <TextView
        android:id="@android:id/message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_gravity="center_horizontal"
        android:textAppearance="@style/TextAppearance.Toast"
        android:textColor="@color/bright_foreground_dark"
        android:shadowColor="#BB000000"
        android:shadowRadius="2.75"
        />

</LinearLayout>

Android SDK\sdk\platforms\android-19\data\res\layout名前付きで見つけましたtransient_notification.xml

于 2014-04-13T09:30:14.620 に答える