自定义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"
   />

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


新闻标题:自定义Toast-创新互联
网页URL:http://pwwzsj.com/article/ddchsj.html