快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

自定义Toast

        

内蒙古网站建设公司成都创新互联,内蒙古网站设计制作,有大型网站制作公司丰富经验。已为内蒙古上千多家提供企业网站建设服务。企业网站搭建\外贸网站制作要多少钱,请找那个售后服务好的内蒙古做网站的公司定做!

View toastRoot = getLayoutInflater().inflate(R.layout.toast, null);  

       TextView message = (TextView) toastRoot.findViewById(R.id.message);  

        message.setText("My Toast");  

  

        Toast toastStart = new Toast(this);  

        toastStart.setGravity(Gravity.BOTTOM, 0, 10);  

        toastStart.setDuration(Toast.LENGTH_LONG);  

        toastStart.setView(toastRoot);  

        toastStart.show();  

toast.xml


    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/toast_frame"
    >
   android:id="@+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"
    />


分享文章:自定义Toast
本文地址:http://6mz.cn/article/jggpjp.html

其他资讯