Android KitKat은 토스트 반경을 얻습니까?
-
21-12-2019 - |
문제
나는 도서관을 이용하고 있어요 로맹누릭 사용자에게 실행 취소 토스트를 표시합니다(예: Gmail 앱에서).
KitKat 이전에는 토스트 옵션이 직사각형이었지만 KitKat에서는 토스트 메시지의 모서리가 둥글었습니다.토스트의 반경을 가져오는 get() 메서드가 있나요?그러면 라이브러리를 사용하면 getRadius()를 사용할 수 있고 그에 따라 토스트를 조정할 수 있나요?
메모:그렇지 않으면 두 개의 다른 값(KitKat 이전 값과 KitKat용 값)을 지정해야 합니다.
해결책
아마도 당신이 원하는 것은 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
제휴하지 않습니다 StackOverflow