level 5
晴天超爱下雨
楼主
require "import"
import "android.widget.*"
import "android.view.*"function 弹出消息(文本)
tcxx={
LinearLayout;--线性布局
orientation='vertical';--布局方向
layout_width='fill';--布局宽度
layout_height='fill';--布局高度
{
CardView;--卡片控件
layout_width='wrap';--卡片宽度
layout_height='wrap';--卡片高度
CardBackgroundColor='#aaeeeeee';--卡片颜色
elevation=0;--阴影属性
radius='19dp';--卡片圆角
{
TextView;
layout_width="wrap";--布局宽度
layout_height="wrap";--布局高度
background="#cc000000";--背景颜色
padding="8dp";--布局填充
textSize="15sp";--文字大小
TextColor="#ffeeeeee";--文字颜色
gravity="center";--布局居中
id="wenzi";--控件ID
};
};
};
local toast=Toast.makeText(activity,"文本",Toast.LENGTH_SHORT).setView(loadlayout(tcxx))
toast.setGravity(Gravity.BOTTOM,0,120)
wenzi.Text=tostring(""..文本.."")
toast.show()
end
--调用方法
弹出消息("文本内容")
2020年06月14日 01点06分
1
import "android.widget.*"
import "android.view.*"function 弹出消息(文本)
tcxx={
LinearLayout;--线性布局
orientation='vertical';--布局方向
layout_width='fill';--布局宽度
layout_height='fill';--布局高度
{
CardView;--卡片控件
layout_width='wrap';--卡片宽度
layout_height='wrap';--卡片高度
CardBackgroundColor='#aaeeeeee';--卡片颜色
elevation=0;--阴影属性
radius='19dp';--卡片圆角
{
TextView;
layout_width="wrap";--布局宽度
layout_height="wrap";--布局高度
background="#cc000000";--背景颜色
padding="8dp";--布局填充
textSize="15sp";--文字大小
TextColor="#ffeeeeee";--文字颜色
gravity="center";--布局居中
id="wenzi";--控件ID
};
};
};
local toast=Toast.makeText(activity,"文本",Toast.LENGTH_SHORT).setView(loadlayout(tcxx))
toast.setGravity(Gravity.BOTTOM,0,120)
wenzi.Text=tostring(""..文本.."")
toast.show()
end
--调用方法
弹出消息("文本内容")