-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtoast.lua
35 lines (35 loc) · 905 Bytes
/
toast.lua
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
import "android.widget.LinearLayout"
import "android.widget.CardView"
import "android.widget.TextView"
import "android.widget.Toast"
import "android.view.Gravity"
function print(内容)
tsbj={
LinearLayout;
layout_width="fill";
layout_height="fill";
gravity="center";
orientation="vertical";
{
CardView;
radius=15,
CardElevation="0dp";
backgroundColor="0xff6f6f6f";
{
TextView;
layout_marginRight="35dp";
text="提示";
id="提示内容",
textColor="0xffffffff";
layout_marginLeft="35dp";
layout_marginTop="10dp";
layout_gravity="center";
layout_marginBottom="10dp";
};
};
};
local toast=Toast.makeText(activity,"内容",Toast.LENGTH_SHORT).setView(loadlayout(tsbj))
toast.setGravity(Gravity.BOTTOM,0,100)
提示内容.Text=tostring(内容)
toast.show()
end