返回顶部

收藏

Android 的 Toast 简单实用示例(用户提醒框)

更多

toast3.png

imgs/asCode/01234758_klSm.png

java代码

Toast toast = Toast.makeText(getApplicationContext(),
   "Hello, The Code Project!", Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0);
LinearLayout toastView = (LinearLayout) toast.getView();
ImageView imageCodeProject = new ImageView(getApplicationContext());
imageCodeProject.setImageResource(R.drawable.codeprojectlogo);
toastView.addView(imageCodeProject, 0);
toast.show();

标签:Toast,Android,SDK

收藏

0人收藏

支持

0

反对

0

发表评论