2011-11-24 33 views

Trả lời

15

Vì vậy, từ xml transient_notification bố trí:

<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="@drawable/toast_frame"> 

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

</LinearLayout> 

nào trỏ tới res/drawable-hdpi/toast_frame.9.png. Hình ảnh đó có vẻ khác nhau từ phiên bản này sang phiên bản khác. Bạn có thể tìm thấy chúng trong thư mục android-sdk của mình, bên trong /platforms/<the version you want>/data/res.

0

Như tôi đã tìm thấy Mặc định Toast Màu và Alpha là như sau

Màu - đen (0, 0, 0)

Alpha - 150

ARGB - (150, 0, 0 , 0)

Bạn có thể sử dụng mã java dưới đây để thực hiện một Toast Rectangular: -

Toast_obj.getView().setBackgroundColor(Color.argb(150, 0, 0, 0)); 
Các vấn đề liên quan