Advertisement
Guest User

Untitled

a guest
Nov 9th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1.  
  2.  
  3. function 控件圆角(id,边框厚度,边框颜色,背景颜色,圆角大小)
  4. import "android.graphics.drawable.GradientDrawable"
  5. drawable=GradientDrawable()
  6. drawable.setShape(GradientDrawable.RECTANGLE)
  7. drawable.setStroke(边框厚度,tonumber(边框颜色))
  8. drawable.setColor(tonumber(背景颜色))
  9. drawable.setCornerRadius(圆角大小)
  10. id.BackgroundDrawable=drawable
  11. end
  12. 字体颜色=0xffb57b58
  13.  
  14.  
  15. bj=
  16. {
  17.  
  18. LinearLayout,
  19. orientation='vertical',
  20. layout_width='fill',
  21. layout_height='wrap',
  22. {
  23. CardView;
  24. layout_gravity='center';
  25. elevation='';
  26. layout_width='90%w';
  27. layout_height='110%w';
  28. radius='50dp';
  29. id='弹窗框架';
  30. {
  31. ImageView;
  32. layout_gravity='center';
  33. layout_width='60%w';
  34. layout_height='60%w';
  35. ColorFilter="0xff0000ff";
  36. scaleType='fitXY';
  37. id='背景图片';
  38. };
  39. {
  40. LinearLayout,
  41. orientation='vertical',
  42. layout_width='fill',
  43. layout_height='fill',
  44. {
  45. TextView;
  46. layout_margin='13dp';
  47. gravity='center';
  48. layout_width='fill';
  49. textColor=字体颜色;
  50. text='标题';
  51. textSize='28';
  52. id='标题';
  53. };
  54. {
  55. CardView;
  56. layout_width='80%w';
  57. CardBackgroundColor="0xff0000ff";
  58. layout_height='2dp';
  59. radius='33dp';
  60. elevation='0';
  61. layout_gravity='center';
  62. };
  63. {
  64. LinearLayout,
  65. orientation='vertical',
  66. layout_width='fill',
  67. layout_height='66%w',
  68. {
  69. TextView;
  70. layout_marginTop='5dp';
  71. gravity='center';
  72. layout_width='fill';
  73. textColor=字体颜色;
  74. text='更新版本:';
  75. textSize='18';
  76. id='更新版本';
  77. };
  78.  
  79. {
  80. TextView;
  81. layout_marginTop='5dp';
  82. layout_marginLeft='20dp';
  83. layout_width='wrap';
  84. layout_height='wrap';
  85. gravity='';
  86. textColor='0xffeb3f97';
  87. text='内容标题:';
  88. textSize='18dp';
  89. id='内容标题';
  90. };
  91. {
  92. TextView;
  93. layout_marginLeft='30dp';
  94. layout_marginRight='13dp';
  95. layout_width='wrap';
  96. layout_height='wrap';
  97. gravity='';
  98. textColor='0xff5a5758';
  99. text="暂无内容";
  100. textSize='15dp';
  101. id='内容';
  102. };
  103. };
  104. {
  105. CardView;
  106. layout_width='80%w';
  107. CardBackgroundColor="0xff0000ff";
  108. layout_height='2dp';
  109. radius='33dp';
  110. elevation='0';
  111. layout_gravity='center';
  112. };
  113. {
  114. LinearLayout,
  115. orientation='horizontal',
  116. layout_width='fill',
  117. layout_height='fill',
  118. background='#00FFFFFF',
  119. gravity='center';
  120. {
  121. TextView;
  122. layout_marginRight='10%w';
  123. gravity='center';
  124. layout_height='fill';
  125. textColor=字体颜色;
  126. text='取消';
  127. textSize='18';
  128. id='取消按键';
  129. onClick=function()
  130. activity.finish()
  131. end
  132. };
  133. {
  134. TextView;
  135. layout_marginLeft='10%w';
  136. gravity='center';
  137. layout_height='fill';
  138. textColor=字体颜色;
  139. text='确定';
  140. textSize='18';
  141. id='确定按键';
  142. onClick=function()
  143.  
  144. activity.finish()
  145.  
  146. end
  147. };
  148. };
  149. };
  150. };
  151. };
  152. import"android.graphics.drawable.ColorDrawable"
  153. a=AlertDialog.Builder(this).show()
  154. a.getWindow().setContentView(loadlayout(bj));
  155. a.getWindow().setBackgroundDrawable(ColorDrawable(0x00000000));
  156. a.setCancelable(false)
  157. 控件圆角(弹窗框架,10,0xff0000ff,0xffffffff,100)
  158.  
  159.  
  160. --[[CSL助手
  161. 作者:幻世楠木
  162. 禁止删除版权]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement