MD风格Toast
2023-01-24 09:16:15 最后更新
//Code By goudie
mian.iyu
fn md.tw("MD提示!")
md.myu
//mdtw
fn tw(show)
nvw(o,o,"线性布局","",obj)
nvw(o,obj,"线性布局","background=#323232",d)
swh("pxw",w)
us(d,"width",w)
nvw(o,d,"文本","linespacingextra=8\nlayout_margintop=14dp\nlayout_marginright=24dp\nlayout_marginbottom=10dp\nlayout_marginleft=24dp\ntextsize=14sp\ntextcolor=#ffffff",b)
us(b,"text",show)
call(toast,"mlua","lua.Toasts",obj)
end fn
lua.mlua
function Toasts(cv)
--自定义tw
import "android.widget.*"
import "android.view.Gravity"
to=Toast(activity)
to:setGravity(Gravity.BOTTOM,0,0);
to:setView(cv)
to:show()
end