how can I find the layout parameters of the toast widget?

纵饮孤独 提交于 2019-12-07 06:43:02

问题


I like the layout of the toast widget very much, that means rounded corners, transparency, light grey border. Is there any way to see the layout parameters of such android standard widgets like the toast?

I would like do define a TextView with the same layout parameters.


回答1:


The layout can be found under {SDKBASEDIR}/platforms/{RELEASE}/res/layout/transient_notification.xml

e.g. for 2.1:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_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>

The drawable toast_frame.9.png can be found under {SDKBASEDIR}/platforms/{RELEASE}/res/drawable{-RESOLUTION}



来源:https://stackoverflow.com/questions/3619670/how-can-i-find-the-layout-parameters-of-the-toast-widget

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!