Lua弹窗模板

Lua弹窗模板

dialog=AlertDialog.Builder(this)

.setTitle("标题").setMessage("消息")
.setPositiveButton("积极",{onClick=function(v) print"点击了积极按钮"end})
.setNeutralButton("中立",nil)
.setNegativeButton("否认",nil)
.show()dialog.create()

--更改消息颜色
message=dialog.findViewById(android.R.id.message)
message.setTextColor(0xff1DA6DD)
--更改Button颜色

import "android.graphics.Color"dialog.getButton(dialog.BUTTON_POSITIVE)
.setTextColor(0xff1DA6DD)dialog.getButton(dialog.BUTTON_NEGATIVE)
.setTextColor(0xff1DA6DD)dialog.getButton(dialog.BUTTON_NEUTRAL)
.setTextColor(0xff1DA6DD)
--更改Title颜色
import "android.text.SpannableString"
import "android.text.style.ForegroundColorSpan"

import 
"android.text.Spannable"
sp = SpannableString("标题")sp
.setSpan(ForegroundColorSpan(0xff1DA6DD),0,#sp,Spannable.SPAN_EXCLUSIVE_INCLUSIVE)dialog
.setTitle(sp)

Lua弹窗模板
觉得有用就点个赞吧

上一篇:spring注解实现线程池


下一篇:nginx default conf