-
Notifications
You must be signed in to change notification settings - Fork 252
/
Toast.txt
35 lines (33 loc) · 1.21 KB
/
Toast.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//simple
//simple
Toast.MakeText(this,"hi", ToastLength.Short).Show();
//complex
Toast t = new Toast(this);
View view = LayoutInflater.Inflate(Resource.Layout.ticket_news, null);
TextView tv = view.FindViewById<TextView>(Resource.Id.Text1);
tv.Text = "hi";
t.View = view;
t.Duration = ToastLength.Short;
t.Show();
/// view
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/whilebackground"
android:padding="8dp">
<LinearLayout
android:id="@+id/Text"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dip">
<TextView
android:id="@+id/Text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF7F3300"
android:textSize="20dip"
android:textStyle="italic" />
</LinearLayout>
</RelativeLayout>