forked from TheMostBlack/Android-Lua
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoast.lua
More file actions
30 lines (30 loc) · 742 Bytes
/
toast.lua
File metadata and controls
30 lines (30 loc) · 742 Bytes
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
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