LoginSignup
1
0

More than 5 years have passed since last update.

[Android] カスタムToast

Posted at

デフォルトのToast:


Context context = getApplicationContext();
CharSequence text = "トーストを表示";
int duration = Toast.LENGTH_SHORT;

Toast toast = Toast.makeText(context, text, duration);
toast.show();

android_android-toast_01.png

カスタムToast:
1_xRGylM8wqFjq7IUxJOJbcQ.png

ライブラリ名:FancyToast-Android
リンク:https://github.com/Shashank02051997/FancyToast-Android

ライブラリを取り込み方:
${module}/build.gradleに下記を追記する。


dependencies {
    ...
    compile 'com.github.Shashank02051997:FancyToast-Android:0.1.3'
}

使い方:

サンプルコード:


FancyToast.makeText(this,"Hello World !",FancyToast.LENGTH_LONG,FancyToast.DEFAULT,true);
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0