B2BÍøÂçÈí¼þ

 ÕÒ»ØÃÜÂë
 Á¢¼´×¢²á ÉóºËÍøÕ¾ºÅ:QQ:896757558
ËÑË÷
²é¿´: 10|»Ø¸´: 0
´òÓ¡ ÉÏÒ»Ö÷Ìâ ÏÂÒ»Ö÷Ìâ

AIWROKÆ»¹û²¿·Ö¹¦ÄÜUI-ˮƽÈÝÆ÷[Horizontal]·½·¨Ð¡½á

[¸´ÖÆÁ´½Ó]

913

Ö÷Ìâ

918

Ìû×Ó

6929

»ý·Ö

abc

Rank: 9Rank: 9Rank: 9

»ý·Ö
6929
Ìø×ªµ½Ö¸¶¨Â¥²ã
Â¥Ö÷
AIWROKÆ»¹û²¿·Ö¹¦ÄÜUI-ˮƽÈÝÆ÷[Horizontal]·½·¨Ð¡½á
AIWROKÆ»¹û²¿·Ö¹¦ÄÜUI-ˮƽÈÝÆ÷[Horizontal]·½·¨Ð¡½á B2BÍøÂçÈí¼þ
  1. //🍎UI-ˮƽÈÝÆ÷[Horizontal]·½·¨Ð¡½á£¬½»Á÷QQȺ711841924

  2. //µÚÒ»¸ö·½·¨£º📌addViewÌí¼Ó×ӿؼþ

  3. var h = new Horizontal();
  4. var btn = new Button();
  5. h.addView(btn);




  6. //µÚ¶þ¸ö·½·¨£º📌removeViewÒÆ³ýÊÓͼ


  7. var h = new Horizontal();
  8. h.removeView(0); // ÒÆ³ýµÚÒ»¸ö×ӿؼþ



  9. //µÚÈý¸ö·½·¨£º📌clearAllViewsÇå¿ÕËùÓÐÊÓͼ


  10. var h = new Horizontal();
  11. h.clearAllViews(); // Çå¿ÕËùÓпؼþ




  12. //µÚËĸö·½·¨£º📌getViewCount »ñÈ¡ÊÓͼÊýÁ¿

  13. var h = new Horizontal();
  14. int count = h.getViewCount(); // »ñÈ¡×ӿؼþµÄÊýÁ¿




  15. //µÚÎå¸ö·½·¨£º📌setSpacingÉèÖÿؼþ¼ä¾à


  16. var h = new Horizontal();
  17. h.setSpacing(10); // ÉèÖÿؼþ¼ä¾àΪ10




  18. //µÚÁù¸ö·½·¨£º📌setBackgroundColorÉèÖñ³¾°ÑÕÉ«

  19. var h = new Horizontal();
  20. h.setBackgroundColor(50,100, 150); // ÉèÖñ³¾°ÑÕɫΪºìÉ«




  21. //µÚÆß¸ö·½·¨£º📌setAlignment ÉèÖÃ¶ÔÆë·½Ê½


  22. var h = new Horizontal();
  23. h.setAlignment("center"); // ÉèÖÃ¶ÔÆë·½Ê½Îª¾ÓÖÐ
  24. /*
  25. ¿ÉѡֵÈçÏ£º
  26. - fill: Ìî³ä¶ÔÆë
  27. - left: ×ó¶ÔÆë
  28. - right: ÓÒ¶ÔÆë
  29. - top: ¶¥²¿¶ÔÆë
  30. - bottom: µ×²¿¶ÔÆë
  31. - center: ¾ÓÖÐ¶ÔÆë
  32. ĬÈÏֵΪ fill¡£
  33. */
¸´ÖÆ´úÂë
📌addViewÌí¼Ó×ӿؼþ
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÏòÈÝÆ÷ÖÐÌí¼ÓÒ»¸ö×ӿؼþ£¬¶à¸ö¿Ø¼þ»áÅÅÁе½Ò»Ðе±ÖÐ
·½·¨Ç©Ãû
Void addView(Object view)
·µ»ØÖµ
Void
²ÎÊý
- Object view
£ºÒªÌí¼ÓµÄ×ӿؼþ¶ÔÏó
°¸Àý
var h = new Horizontal();
var btn = new Button();
h.addView(btn);
📌removeViewÒÆ³ýÊÓͼ
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
¸ù¾ÝÖ¸¶¨Ë÷ÒýÒÆ³ýÈÝÆ÷ÖеÄ×ӿؼþ
·½·¨Ç©Ãû
Void removeView(Int32 index)
·µ»ØÖµ
Void
²ÎÊý
- Int32 index
£ºÒªÒƳýµÄ×ӿؼþµÄË÷Òý£¨´Ó 0 ¿ªÊ¼¼ÆÊý£©
°¸Àý
var h = new Horizontal();
h.removeView(0); // ÒÆ³ýµÚÒ»¸ö×ӿؼþ
📌clearAllViewsÇå¿ÕËùÓÐÊÓͼ
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÒÆ³ýÈÝÆ÷ÖеÄËùÓÐ×ӿؼþ
·½·¨Ç©Ãû
Void clearAllViews()
·µ»ØÖµ
Void
²ÎÊý
ÎÞ
°¸Àý
var h = new Horizontal();
h.clearAllViews(); // Çå¿ÕËùÓпؼþ
📌getViewCount »ñÈ¡ÊÓͼÊýÁ¿
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
·µ»Øµ±Ç°ÈÝÆ÷ÖеÄÊÓͼÊýÁ¿
·½·¨Ç©Ãû
Int32 getViewCount()
·µ»ØÖµ
Int32
²ÎÊý
ÎÞ
°¸Àý
var h = new Horizontal();
int count = h.getViewCount(); // »ñÈ¡×ӿؼþµÄÊýÁ¿
📌setSpacingÉèÖÿؼþ¼ä¾à
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÉèÖÃ×ӿؼþÖ®¼äµÄ¼ä¾à
·½·¨Ç©Ãû
Void setSpacing(Int32 spacing)
·µ»ØÖµ
Void
²ÎÊý
- Int32 spacing
£ºÒªÉèÖõÄ×ӿؼþ¼ä¾àÖµ
°¸Àý
var h = new Horizontal();
h.setSpacing(10); // ÉèÖÿؼþ¼ä¾àΪ10
📌setBackgroundColorÉèÖñ³¾°ÑÕÉ«
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
¸ù¾ÝÌṩµÄ RGB ÖµÉèÖÃÈÝÆ÷µÄ±³¾°ÑÕÉ«
·½·¨Ç©Ãû
Void setBackgroundColor(Int32 red, Int32 green, Int32 blue)
·µ»ØÖµ
Void
²ÎÊý
- Int32 red
£ººìÉ«·ÖÁ¿£¨Í¨³£È¡Öµ·¶Î§ 0~255
£©
- Int32 green
£ºÂÌÉ«·ÖÁ¿£¨Í¨³£È¡Öµ·¶Î§ 0~255
£©
- Int32 blue
£ºÀ¶É«·ÖÁ¿£¨Í¨³£È¡Öµ·¶Î§ 0~255
£©
°¸Àý
var h = new Horizontal();
h.setBackgroundColor(50,100, 150); // ÉèÖñ³¾°ÑÕɫΪºìÉ«
📌setAlignment ÉèÖÃ¶ÔÆë·½Ê½
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÉèÖÃÈÝÆ÷ÄڿؼþµÄ¶ÔÆë·½Ê½
·½·¨Ç©Ãû
Void setAlignment(String alignment)
·µ»ØÖµ
Void
²ÎÊý
-String alignment
£º¶ÔÆë·½Ê½£¬¿Éѡֵ£º -fill
£ºÌî³ä¶ÔÆë -left
£º×ó¶ÔÆë -right
£ºÓÒ¶ÔÆë -top
£º¶¥²¿¶ÔÆë -bottom
£ºµ×²¿¶ÔÆë -center
£º¾ÓÖÐ¶ÔÆë ĬÈÏֵΪfill
°¸Àý
var h = new Horizontal();
h.setAlignment("center"); // ÉèÖÃ¶ÔÆë·½Ê½Îª¾ÓÖÐ
/*
¿ÉѡֵÈçÏ£º
- fill: Ìî³ä¶ÔÆë
- left: ×ó¶ÔÆë
- right: ÓÒ¶ÔÆë
- top: ¶¥²¿¶ÔÆë
- bottom: µ×²¿¶ÔÆë
- center: ¾ÓÖÐ¶ÔÆë
ĬÈÏֵΪ fill¡£
*/
ʾÀý×Ó 1 ·ç¸ñ£º
  1. // 🔨UI-ˮƽÈÝÆ÷[Horizontal]·½·¨ÍêÕûʾÀý
  2. // 🍎UI-ˮƽÈÝÆ÷[Horizontal]·½·¨Ð¡½á£¬½»Á÷QQȺ711841924

  3. printl("=== Horizontal¿Ø¼þ·½·¨ÍêÕûʾÀý ===");

  4. var vc = new IOSView();
  5. vc.show(() => {
  6.     printl("HorizontalʾÀý½çÃæÒѼÓÔØ");
  7.    
  8.     // »ñÈ¡µ±Ç°ÊÓͼ
  9.     var view = vc.getView();
  10.    
  11.     // ´´½¨Ö÷ÈÝÆ÷
  12.     var mainContainer = new Vertical();
  13.     mainContainer.setSpacing(15);
  14.     mainContainer.setBackgroundColor(245, 245, 245);
  15.    
  16.     // ±êÌâÇøÓò
  17.     var titleContainer = new Vertical();
  18.     titleContainer.setAlignment("center");
  19.     titleContainer.setSpacing(5);
  20.     titleContainer.setBackgroundColor(0, 122, 255);
  21.    
  22.     var titleLabel = new Label();
  23.     titleLabel.setText("🔨 Horizontal¿Ø¼þÑÝʾ");
  24.     titleLabel.setFontSize(20.0);
  25.     titleLabel.setTextColor(255, 255, 255);
  26.     titleLabel.setTextAlignment("center");
  27.    
  28.     titleContainer.addView(titleLabel);
  29.     mainContainer.addView(titleContainer);
  30.    
  31.     // Horizontal·½·¨ÑÝÊ¾ÇøÓò
  32.     var demoContainer = new Vertical();
  33.     demoContainer.setBackgroundColor(255, 255, 255);
  34.     demoContainer.setSpacing(15);
  35.    
  36.     var demoTitle = new Label();
  37.     demoTitle.setText("Horizontal¿Ø¼þ¹¦ÄÜÑÝʾ");
  38.     demoTitle.setFontSize(16.0);
  39.     demoTitle.setTextColor(0, 0, 0);
  40.     demoTitle.setTextAlignment("center");
  41.     demoContainer.addView(demoTitle);
  42.    
  43.     // µÚÒ»¸ö·½·¨£ºaddViewÌí¼Ó×ӿؼþ
  44.     var addViewDemo = new Vertical();
  45.     addViewDemo.setSpacing(5);
  46.    
  47.     var addViewLabel = new Label();
  48.     addViewLabel.setText("📌 addViewÌí¼Ó×ӿؼþ");
  49.     addViewLabel.setFontSize(14.0);
  50.     addViewLabel.setTextColor(0, 122, 255);
  51.     addViewDemo.addView(addViewLabel);
  52.    
  53.     var h1 = new Horizontal();
  54.     h1.setSpacing(10);
  55.     h1.setBackgroundColor(240, 240, 240);
  56.    
  57.     var btn1 = new Button();
  58.     btn1.setText("°´Å¥1");
  59.     btn1.setColor(0, 122, 255);
  60.     btn1.setTextColor(255, 255, 255);
  61.     btn1.setWidth(80);
  62.     btn1.setHeight(40);
  63.    
  64.     var btn2 = new Button();
  65.     btn2.setText("°´Å¥2");
  66.     btn2.setColor(52, 199, 89);
  67.     btn2.setTextColor(255, 255, 255);
  68.     btn2.setWidth(80);
  69.     btn2.setHeight(40);
  70.    
  71.     var btn3 = new Button();
  72.     btn3.setText("°´Å¥3");
  73.     btn3.setColor(255, 149, 0);
  74.     btn3.setTextColor(255, 255, 255);
  75.     btn3.setWidth(80);
  76.     btn3.setHeight(40);
  77.    
  78.     // µÚÒ»¸ö·½·¨£ºaddViewÌí¼Ó×ӿؼþ
  79.     h1.addView(btn1);
  80.     h1.addView(btn2);
  81.     h1.addView(btn3);
  82.    
  83.     addViewDemo.addView(h1);
  84.     demoContainer.addView(addViewDemo);
  85.    
  86.     // µÚ¶þ¸ö·½·¨£ºremoveViewÒÆ³ýÊÓͼ
  87.     var removeViewDemo = new Vertical();
  88.     removeViewDemo.setSpacing(5);
  89.    
  90.     var removeViewLabel = new Label();
  91.     removeViewLabel.setText("📌 removeViewÒÆ³ýÊÓͼ");
  92.     removeViewLabel.setFontSize(14.0);
  93.     removeViewLabel.setTextColor(0, 122, 255);
  94.     removeViewDemo.addView(removeViewLabel);
  95.    
  96.     var h2 = new Horizontal();
  97.     h2.setSpacing(10);
  98.     h2.setBackgroundColor(240, 240, 240);
  99.    
  100.     var removeBtn1 = new Button();
  101.     removeBtn1.setText("A");
  102.     removeBtn1.setColor(0, 122, 255);
  103.     removeBtn1.setTextColor(255, 255, 255);
  104.     removeBtn1.setWidth(60);
  105.     removeBtn1.setHeight(40);
  106.    
  107.     var removeBtn2 = new Button();
  108.     removeBtn2.setText("B");
  109.     removeBtn2.setColor(52, 199, 89);
  110.     removeBtn2.setTextColor(255, 255, 255);
  111.     removeBtn2.setWidth(60);
  112.     removeBtn2.setHeight(40);
  113.    
  114.     var removeBtn3 = new Button();
  115.     removeBtn3.setText("C");
  116.     removeBtn3.setColor(255, 149, 0);
  117.     removeBtn3.setTextColor(255, 255, 255);
  118.     removeBtn3.setWidth(60);
  119.     removeBtn3.setHeight(40);
  120.    
  121.     h2.addView(removeBtn1);
  122.     h2.addView(removeBtn2);
  123.     h2.addView(removeBtn3);
  124.    
  125.     var removeButton = new Button();
  126.     removeButton.setText("ÒÆ³ýµÚÒ»¸ö");
  127.     removeButton.setColor(255, 59, 48);
  128.     removeButton.setTextColor(255, 255, 255);
  129.     removeButton.setWidth(100);
  130.     removeButton.setHeight(40);
  131.    
  132.     removeButton.onClick(() => {
  133.         // µÚ¶þ¸ö·½·¨£ºremoveViewÒÆ³ýÊÓͼ
  134.         if (h2.getViewCount() > 0) {
  135.             h2.removeView(0); // ÒÆ³ýµÚÒ»¸ö×ӿؼþ
  136.             printl("ÒÑÒÆ³ýµÚÒ»¸ö¿Ø¼þ£¬Ê£Óà¿Ø¼þÊý: " + h2.getViewCount());
  137.         } else {
  138.             printl("ûÓпÉÒÆ³ýµÄ¿Ø¼þ");
  139.         }
  140.     });
  141.    
  142.     var removeContainer = new Horizontal();
  143.     removeContainer.setSpacing(10);
  144.     removeContainer.addView(h2);
  145.     removeContainer.addView(removeButton);
  146.    
  147.     removeViewDemo.addView(removeContainer);
  148.     demoContainer.addView(removeViewDemo);
  149.    
  150.     // µÚÈý¸ö·½·¨£ºclearAllViewsÇå¿ÕËùÓÐÊÓͼ
  151.     var clearAllViewsDemo = new Vertical();
  152.     clearAllViewsDemo.setSpacing(5);
  153.    
  154.     var clearAllViewsLabel = new Label();
  155.     clearAllViewsLabel.setText("📌 clearAllViewsÇå¿ÕËùÓÐÊÓͼ");
  156.     clearAllViewsLabel.setFontSize(14.0);
  157.     clearAllViewsLabel.setTextColor(0, 122, 255);
  158.     clearAllViewsDemo.addView(clearAllViewsLabel);
  159.    
  160.     var h3 = new Horizontal();
  161.     h3.setSpacing(10);
  162.     h3.setBackgroundColor(240, 240, 240);
  163.    
  164.     var clearBtn1 = new Button();
  165.     clearBtn1.setText("X");
  166.     clearBtn1.setColor(0, 122, 255);
  167.     clearBtn1.setTextColor(255, 255, 255);
  168.     clearBtn1.setWidth(60);
  169.     clearBtn1.setHeight(40);
  170.    
  171.     var clearBtn2 = new Button();
  172.     clearBtn2.setText("Y");
  173.     clearBtn2.setColor(52, 199, 89);
  174.     clearBtn2.setTextColor(255, 255, 255);
  175.     clearBtn2.setWidth(60);
  176.     clearBtn2.setHeight(40);
  177.    
  178.     var clearBtn3 = new Button();
  179.     clearBtn3.setText("Z");
  180.     clearBtn3.setColor(255, 149, 0);
  181.     clearBtn3.setTextColor(255, 255, 255);
  182.     clearBtn3.setWidth(60);
  183.     clearBtn3.setHeight(40);
  184.    
  185.     h3.addView(clearBtn1);
  186.     h3.addView(clearBtn2);
  187.     h3.addView(clearBtn3);
  188.    
  189.     var clearButton = new Button();
  190.     clearButton.setText("Çå¿ÕËùÓÐ");
  191.     clearButton.setColor(255, 59, 48);
  192.     clearButton.setTextColor(255, 255, 255);
  193.     clearButton.setWidth(100);
  194.     clearButton.setHeight(40);
  195.    
  196.     clearButton.onClick(() => {
  197.         // µÚÈý¸ö·½·¨£ºclearAllViewsÇå¿ÕËùÓÐÊÓͼ
  198.         h3.clearAllViews(); // Çå¿ÕËùÓпؼþ
  199.         printl("ÒÑÇå¿ÕËùÓпؼþ");
  200.         
  201.         // ÖØÐÂÌí¼ÓÒ»¸öÌáʾ±êÇ©
  202.         var emptyLabel = new Label();
  203.         emptyLabel.setText("ÒÑÇå¿Õ");
  204.         emptyLabel.setFontSize(12.0);
  205.         emptyLabel.setTextColor(100, 100, 100);
  206.         h3.addView(emptyLabel);
  207.     });
  208.    
  209.     var clearContainer = new Horizontal();
  210.     clearContainer.setSpacing(10);
  211.     clearContainer.addView(h3);
  212.     clearContainer.addView(clearButton);
  213.    
  214.     clearAllViewsDemo.addView(clearContainer);
  215.     demoContainer.addView(clearAllViewsDemo);
  216.    
  217.     // µÚËĸö·½·¨£ºgetViewCount »ñÈ¡ÊÓͼÊýÁ¿
  218.     var getViewCountDemo = new Vertical();
  219.     getViewCountDemo.setSpacing(5);
  220.    
  221.     var getViewCountLabel = new Label();
  222.     getViewCountLabel.setText("📌 getViewCount »ñÈ¡ÊÓͼÊýÁ¿");
  223.     getViewCountLabel.setFontSize(14.0);
  224.     getViewCountLabel.setTextColor(0, 122, 255);
  225.     getViewCountDemo.addView(getViewCountLabel);
  226.    
  227.     var h4 = new Horizontal();
  228.     h4.setSpacing(10);
  229.     h4.setBackgroundColor(240, 240, 240);
  230.    
  231.     var countBtn1 = new Button();
  232.     countBtn1.setText("1");
  233.     countBtn1.setColor(0, 122, 255);
  234.     countBtn1.setTextColor(255, 255, 255);
  235.     countBtn1.setWidth(60);
  236.     countBtn1.setHeight(40);
  237.    
  238.     var countBtn2 = new Button();
  239.     countBtn2.setText("2");
  240.     countBtn2.setColor(52, 199, 89);
  241.     countBtn2.setTextColor(255, 255, 255);
  242.     countBtn2.setWidth(60);
  243.     countBtn2.setHeight(40);
  244.    
  245.     h4.addView(countBtn1);
  246.     h4.addView(countBtn2);
  247.    
  248.     var countButton = new Button();
  249.     countButton.setText("»ñÈ¡ÊýÁ¿");
  250.     countButton.setColor(111, 66, 193);
  251.     countButton.setTextColor(255, 255, 255);
  252.     countButton.setWidth(100);
  253.     countButton.setHeight(40);
  254.    
  255.     countButton.onClick(() => {
  256.         // µÚËĸö·½·¨£ºgetViewCount »ñÈ¡ÊÓͼÊýÁ¿
  257.         var count = h4.getViewCount(); // »ñÈ¡×ӿؼþµÄÊýÁ¿
  258.         printl("µ±Ç°¿Ø¼þÊýÁ¿: " + count);
  259.         
  260.         var resultLabel = new Label();
  261.         resultLabel.setText("¿Ø¼þÊýÁ¿: " + count);
  262.         resultLabel.setFontSize(12.0);
  263.         resultLabel.setTextColor(111, 66, 193);
  264.         getViewCountDemo.addView(resultLabel);
  265.     });
  266.    
  267.     var countContainer = new Horizontal();
  268.     countContainer.setSpacing(10);
  269.     countContainer.addView(h4);
  270.     countContainer.addView(countButton);
  271.    
  272.     getViewCountDemo.addView(countContainer);
  273.     demoContainer.addView(getViewCountDemo);
  274.    
  275.     // µÚÎå¸ö·½·¨£ºsetSpacingÉèÖÿؼþ¼ä¾à
  276.     var setSpacingDemo = new Vertical();
  277.     setSpacingDemo.setSpacing(5);
  278.    
  279.     var setSpacingLabel = new Label();
  280.     setSpacingLabel.setText("📌 setSpacingÉèÖÿؼþ¼ä¾à");
  281.     setSpacingLabel.setFontSize(14.0);
  282.     setSpacingLabel.setTextColor(0, 122, 255);
  283.     setSpacingDemo.addView(setSpacingLabel);
  284.    
  285.     var h5 = new Horizontal();
  286.     // µÚÎå¸ö·½·¨£ºsetSpacingÉèÖÿؼþ¼ä¾à
  287.     h5.setSpacing(20); // ÉèÖÿؼþ¼ä¾àΪ20
  288.     h5.setBackgroundColor(240, 240, 240);
  289.    
  290.     var spacingBtn1 = new Button();
  291.     spacingBtn1.setText("¼ä¾à´ó");
  292.     spacingBtn1.setColor(0, 122, 255);
  293.     spacingBtn1.setTextColor(255, 255, 255);
  294.     spacingBtn1.setWidth(80);
  295.     spacingBtn1.setHeight(40);
  296.    
  297.     var spacingBtn2 = new Button();
  298.     spacingBtn2.setText("¼ä¾à´ó");
  299.     spacingBtn2.setColor(52, 199, 89);
  300.     spacingBtn2.setTextColor(255, 255, 255);
  301.     spacingBtn2.setWidth(80);
  302.     spacingBtn2.setHeight(40);
  303.    
  304.     h5.addView(spacingBtn1);
  305.     h5.addView(spacingBtn2);
  306.    
  307.     setSpacingDemo.addView(h5);
  308.     demoContainer.addView(setSpacingDemo);
  309.    
  310.     // µÚÁù¸ö·½·¨£ºsetBackgroundColorÉèÖñ³¾°ÑÕÉ«
  311.     var setBackgroundColorDemo = new Vertical();
  312.     setBackgroundColorDemo.setSpacing(5);
  313.    
  314.     var setBackgroundColorLabel = new Label();
  315.     setBackgroundColorLabel.setText("📌 setBackgroundColorÉèÖñ³¾°ÑÕÉ«");
  316.     setBackgroundColorLabel.setFontSize(14.0);
  317.     setBackgroundColorLabel.setTextColor(0, 122, 255);
  318.     setBackgroundColorDemo.addView(setBackgroundColorLabel);
  319.    
  320.     var h6 = new Horizontal();
  321.     h6.setSpacing(10);
  322.     // µÚÁù¸ö·½·¨£ºsetBackgroundColorÉèÖñ³¾°ÑÕÉ«
  323.     h6.setBackgroundColor(50, 100, 150); // ÉèÖñ³¾°ÑÕɫΪRGB(50,100,150)
  324.    
  325.     var bgBtn1 = new Button();
  326.     bgBtn1.setText("±³¾°É«1");
  327.     bgBtn1.setColor(255, 255, 255);
  328.     bgBtn1.setTextColor(0, 0, 0);
  329.     bgBtn1.setWidth(80);
  330.     bgBtn1.setHeight(40);
  331.    
  332.     var bgBtn2 = new Button();
  333.     bgBtn2.setText("±³¾°É«2");
  334.     bgBtn2.setColor(255, 255, 255);
  335.     bgBtn2.setTextColor(0, 0, 0);
  336.     bgBtn2.setWidth(80);
  337.     bgBtn2.setHeight(40);
  338.    
  339.     h6.addView(bgBtn1);
  340.     h6.addView(bgBtn2);
  341.    
  342.     setBackgroundColorDemo.addView(h6);
  343.     demoContainer.addView(setBackgroundColorDemo);
  344.    
  345.     // µÚÆß¸ö·½·¨£ºsetAlignment ÉèÖÃ¶ÔÆë·½Ê½
  346.     var setAlignmentDemo = new Vertical();
  347.     setAlignmentDemo.setSpacing(5);
  348.    
  349.     var setAlignmentLabel = new Label();
  350.     setAlignmentLabel.setText("📌 setAlignment ÉèÖÃ¶ÔÆë·½Ê½");
  351.     setAlignmentLabel.setFontSize(14.0);
  352.     setAlignmentLabel.setTextColor(0, 122, 255);
  353.     setAlignmentDemo.addView(setAlignmentLabel);
  354.    
  355.     // ¾ÓÖÐ¶ÔÆëʾÀý
  356.     var hCenter = new Horizontal();
  357.     hCenter.setSpacing(10);
  358.     hCenter.setBackgroundColor(240, 240, 240);
  359.     // µÚÆß¸ö·½·¨£ºsetAlignment ÉèÖÃ¶ÔÆë·½Ê½
  360.     hCenter.setAlignment("center"); // ÉèÖÃ¶ÔÆë·½Ê½Îª¾ÓÖÐ
  361.    
  362.     var centerBtn = new Button();
  363.     centerBtn.setText("¾ÓÖÐ");
  364.     centerBtn.setColor(0, 122, 255);
  365.     centerBtn.setTextColor(255, 255, 255);
  366.     centerBtn.setWidth(80);
  367.     centerBtn.setHeight(40);
  368.    
  369.     hCenter.addView(centerBtn);
  370.    
  371.     var centerLabel = new Label();
  372.     centerLabel.setText("¾ÓÖÐ¶ÔÆë");
  373.     centerLabel.setFontSize(12.0);
  374.     centerLabel.setTextColor(100, 100, 100);
  375.    
  376.     setAlignmentDemo.addView(centerLabel);
  377.     setAlignmentDemo.addView(hCenter);
  378.    
  379.     // ×ó¶ÔÆëʾÀý
  380.     var hLeft = new Horizontal();
  381.     hLeft.setSpacing(10);
  382.     hLeft.setBackgroundColor(240, 240, 240);
  383.     hLeft.setAlignment("left"); // ÉèÖÃ¶ÔÆë·½Ê½Îª×ó¶ÔÆë
  384.    
  385.     var leftBtn = new Button();
  386.     leftBtn.setText("×ó¶ÔÆë");
  387.     leftBtn.setColor(52, 199, 89);
  388.     leftBtn.setTextColor(255, 255, 255);
  389.     leftBtn.setWidth(80);
  390.     leftBtn.setHeight(40);
  391.    
  392.     hLeft.addView(leftBtn);
  393.    
  394.     var leftLabel = new Label();
  395.     leftLabel.setText("×ó¶ÔÆë");
  396.     leftLabel.setFontSize(12.0);
  397.     leftLabel.setTextColor(100, 100, 100);
  398.    
  399.     setAlignmentDemo.addView(leftLabel);
  400.     setAlignmentDemo.addView(hLeft);
  401.    
  402.     // ÓÒ¶ÔÆëʾÀý
  403.     var hRight = new Horizontal();
  404.     hRight.setSpacing(10);
  405.     hRight.setBackgroundColor(240, 240, 240);
  406.     hRight.setAlignment("right"); // ÉèÖÃ¶ÔÆë·½Ê½ÎªÓÒ¶ÔÆë
  407.    
  408.     var rightBtn = new Button();
  409.     rightBtn.setText("ÓÒ¶ÔÆë");
  410.     rightBtn.setColor(255, 149, 0);
  411.     rightBtn.setTextColor(255, 255, 255);
  412.     rightBtn.setWidth(80);
  413.     rightBtn.setHeight(40);
  414.    
  415.     hRight.addView(rightBtn);
  416.    
  417.     var rightLabel = new Label();
  418.     rightLabel.setText("ÓÒ¶ÔÆë");
  419.     rightLabel.setFontSize(12.0);
  420.     rightLabel.setTextColor(100, 100, 100);
  421.    
  422.     setAlignmentDemo.addView(rightLabel);
  423.     setAlignmentDemo.addView(hRight);
  424.    
  425.     demoContainer.addView(setAlignmentDemo);
  426.    
  427.     mainContainer.addView(demoContainer);
  428.    
  429.     // ʵ¼ÊÓ¦ÓÃʾÀý
  430.     var applicationContainer = new Vertical();
  431.     applicationContainer.setBackgroundColor(255, 255, 255);
  432.     applicationContainer.setSpacing(15);
  433.    
  434.     var appTitle = new Label();
  435.     appTitle.setText("Horizontalʵ¼ÊÓ¦ÓÃʾÀý");
  436.     appTitle.setFontSize(16.0);
  437.     appTitle.setTextColor(0, 0, 0);
  438.     appTitle.setTextAlignment("center");
  439.     applicationContainer.addView(appTitle);
  440.    
  441.     // °´Å¥×éʾÀý
  442.     var buttonGroup = new Horizontal();
  443.     buttonGroup.setSpacing(10);
  444.     buttonGroup.setAlignment("center");
  445.     buttonGroup.setBackgroundColor(240, 240, 240);
  446.    
  447.     var homeBtn = new Button();
  448.     homeBtn.setText("🏠 Ê×Ò³");
  449.     homeBtn.setColor(0, 122, 255);
  450.     homeBtn.setTextColor(255, 255, 255);
  451.     homeBtn.setWidth(80);
  452.     homeBtn.setHeight(40);
  453.    
  454.     var searchBtn = new Button();
  455.     searchBtn.setText("🔍 ËÑË÷");
  456.     searchBtn.setColor(52, 199, 89);
  457.     searchBtn.setTextColor(255, 255, 255);
  458.     searchBtn.setWidth(80);
  459.     searchBtn.setHeight(40);
  460.    
  461.     var profileBtn = new Button();
  462.     profileBtn.setText("👤 ÎÒµÄ");
  463.     profileBtn.setColor(255, 149, 0);
  464.     profileBtn.setTextColor(255, 255, 255);
  465.     profileBtn.setWidth(80);
  466.     profileBtn.setHeight(40);
  467.    
  468.     buttonGroup.addView(homeBtn);
  469.     buttonGroup.addView(searchBtn);
  470.     buttonGroup.addView(profileBtn);
  471.    
  472.     applicationContainer.addView(buttonGroup);
  473.    
  474.     // ͼ±ê+ÎÄ×Ö×éºÏʾÀý
  475.     var iconTextGroup = new Horizontal();
  476.     iconTextGroup.setSpacing(20);
  477.     iconTextGroup.setAlignment("center");
  478.     iconTextGroup.setBackgroundColor(245, 245, 245);
  479.    
  480.     // µÚÒ»×é
  481.     var group1 = new Vertical();
  482.     group1.setSpacing(5);
  483.     group1.setAlignment("center");
  484.    
  485.     var icon1 = new Label();
  486.     icon1.setText("📧");
  487.     icon1.setFontSize(24.0);
  488.     icon1.setTextAlignment("center");
  489.    
  490.     var text1 = new Label();
  491.     text1.setText("Óʼþ");
  492.     text1.setFontSize(12.0);
  493.     text1.setTextAlignment("center");
  494.     text1.setTextColor(100, 100, 100);
  495.    
  496.     group1.addView(icon1);
  497.     group1.addView(text1);
  498.    
  499.     // µÚ¶þ×é
  500.     var group2 = new Vertical();
  501.     group2.setSpacing(5);
  502.     group2.setAlignment("center");
  503.    
  504.     var icon2 = new Label();
  505.     icon2.setText("📅");
  506.     icon2.setFontSize(24.0);
  507.     icon2.setTextAlignment("center");
  508.    
  509.     var text2 = new Label();
  510.     text2.setText("ÈÕÀú");
  511.     text2.setFontSize(12.0);
  512.     text2.setTextAlignment("center");
  513.     text2.setTextColor(100, 100, 100);
  514.    
  515.     group2.addView(icon2);
  516.     group2.addView(text2);
  517.    
  518.     // µÚÈý×é
  519.     var group3 = new Vertical();
  520.     group3.setSpacing(5);
  521.     group3.setAlignment("center");
  522.    
  523.     var icon3 = new Label();
  524.     icon3.setText("📷");
  525.     icon3.setFontSize(24.0);
  526.     icon3.setTextAlignment("center");
  527.    
  528.     var text3 = new Label();
  529.     text3.setText("Ïà»ú");
  530.     text3.setFontSize(12.0);
  531.     text3.setTextAlignment("center");
  532.     text3.setTextColor(100, 100, 100);
  533.    
  534.     group3.addView(icon3);
  535.     group3.addView(text3);
  536.    
  537.     iconTextGroup.addView(group1);
  538.     iconTextGroup.addView(group2);
  539.     iconTextGroup.addView(group3);
  540.    
  541.     applicationContainer.addView(iconTextGroup);
  542.     mainContainer.addView(applicationContainer);
  543.    
  544.     // ¿Ø¼þÐÅÏ¢ÇøÓò
  545.     var infoContainer = new Vertical();
  546.     infoContainer.setBackgroundColor(236, 245, 255);
  547.     infoContainer.setSpacing(8);
  548.    
  549.     var infoTitle = new Label();
  550.     infoTitle.setText("ℹ️ Horizontal¿Ø¼þ˵Ã÷");
  551.     infoTitle.setFontSize(16.0);
  552.     infoTitle.setTextColor(0, 122, 255);
  553.     infoContainer.addView(infoTitle);
  554.    
  555.     var info1 = new Label();
  556.     info1.setText("• Horizontal¿Ø¼þÓÃÓÚˮƽÅÅÁÐ×ӿؼþ");
  557.     info1.setFontSize(12.0);
  558.     info1.setTextColor(52, 58, 64);
  559.     infoContainer.addView(info1);
  560.    
  561.     var info2 = new Label();
  562.     info2.setText("• Ö§³ÖÌí¼Ó¡¢ÒƳý¡¢Çå¿Õ×ӿؼþ");
  563.     info2.setFontSize(12.0);
  564.     info2.setTextColor(52, 58, 64);
  565.     infoContainer.addView(info2);
  566.    
  567.     var info3 = new Label();
  568.     info3.setText("• ¿ÉÉèÖüä¾à¡¢±³¾°É«ºÍ¶ÔÆë·½Ê½");
  569.     info3.setFontSize(12.0);
  570.     info3.setTextColor(52, 58, 64);
  571.     infoContainer.addView(info3);
  572.    
  573.     mainContainer.addView(infoContainer);
  574.    
  575.     // µ×²¿°´Å¥
  576.     var bottomContainer = new Horizontal();
  577.     bottomContainer.setSpacing(10);
  578.     bottomContainer.setAlignment("center");
  579.    
  580.     var exitBtn = new Button();
  581.     exitBtn.setText("Í˳öʾÀý");
  582.     exitBtn.setColor(255, 59, 48);
  583.     exitBtn.setTextColor(255, 255, 255);
  584.     exitBtn.setHeight(40);
  585.    
  586.     exitBtn.onClick(() => {
  587.         printl("Í˳ö°´Å¥±»µã»÷");
  588.         vc.dismiss();
  589.     });
  590.    
  591.     bottomContainer.addView(exitBtn);
  592.     mainContainer.addView(bottomContainer);
  593.    
  594.     // Ìí¼Óµ½Ö÷ÊÓͼ
  595.     view.addView(mainContainer);
  596.    
  597.     printl("HorizontalʾÀý½çÃæ¹¹½¨Íê³É");
  598. });

  599. printl("Horizontal¿Ø¼þÍêÕûʾÀýÒÑÆô¶¯");
¸´ÖÆ´úÂë



»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

±¾°æ»ý·Ö¹æÔò

¹Ø±Õ

QQ|»ÓªÏúÈí¼þ×ÛºÏÌÖÂÛ|»ÓªÏúÈí¼þÓÐÎʱشð|»ÓªÏúÈí¼þ½Ì³Ì×¨Çø|»ÓªÏúÈí¼þPOST½Å±¾·ÖÏí|»ÓªÏúÈí¼þÆÕͨ½Å±¾·ÖÏí|»ÓªÏúÈí¼þÈí¼þ×ÊѶ|»ÓªÏúÈí¼þ¾«Æ·Èí¼þ|»ÓªÏúÈí¼þ¸üй«¸æ|ÓªÏúÈí¼þ|B2BÈí¼þ|B2BÍøÂçÈí¼þ ( ¾©ICP±¸09078825ºÅ )±¾ÍøÕ¾¿ª·¢µÄÓªÏúÈí¼þÊÇÒ»¿îеÄÍøÂçÓªÏúÈí¼þ£¬Õâ¿îÓªÏú¿ÉÒÔÈ¥ÍøÕ¾Èí¼þ£¬²©¿ÍÈí¼þ£¬B2BÈí¼þ£¬·ÖÀàÐÅÏ¢Íø·¢Ìù£¬¿ÉÒÔÇÀɳ·¢£¬¿ÉÒÔµ½°Ù¶ÈÎÄ¿âÉÏ´«WORDÎĵµ£¬¿ÉÒÔµ½Ò»Ð©ÊÇÏà²áÍøÕ¾×Ô¶¯ÉÏ´«Í¼Æ¬£¬Õâ¸ö×Ô¶¯·¢ÌûÈí¼þ×Ô´øÔÆÖ©Ö룬¼Ó¿ìÊÕ¼£¬ÓÐ6ÖÖ¶Ô½Ó´òÂë½Ó¿Ú£¬·½±ã£¬Ð§Âʸߣ¬Ëٶȿ죬¶øÇÒ¶ÔÍ϶¯µÄÑéÖ¤ÂëÈ«ÍøµÚÒ»¼Ò¶À¼ÒÖ§³Ö£¬È«²¿Ô­´´¼¼Êõ£¬¶À¼ÒÑз¢£¬Õý°æÔ­´´´ø°æÈ¨Èí¼þ¡£Ñ¡ÔñÍòÄÜÓªÏúÈí¼þ£¬¾ÍÑ¡ÔñÁËÒ»ÖÖ׬ǮµÄЧÂÊ£¬´ÓûÓб»³¬Ô½¹ý£¬Ò»Ö±ÔÚŬÁ¦Ñз¢Ð¼¼Êõ¡£·Å·ÉÃÎÏ룬½â·ÅË«ÊÖ£¬À´µã´´Ò⣬³É¾ÍÄãµÄÃÎÏ룬¾ÍÔÚÍòÄÜÓªÏúÈí¼þ¿ªÊ¼

map2

GMT+8, 2025-8-7 18:32 , Processed in 0.103558 second(s), 36 queries .

¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí