B2BÍøÂçÈí¼þ

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

AIWROKÈí¼þÆ»¹ûIOSÀïµÄUI-ÊäÈë¿òÀà[Input]·½·¨Ð¡½á

[¸´ÖÆÁ´½Ó]

912

Ö÷Ìâ

917

Ìû×Ó

6925

»ý·Ö

abc

Rank: 9Rank: 9Rank: 9

»ý·Ö
6925
Ìø×ªµ½Ö¸¶¨Â¥²ã
Â¥Ö÷
AIWROKÈí¼þÆ»¹ûIOSÀïµÄUI-ÊäÈë¿òÀà[Input]·½·¨Ð¡½á
  1. //🍎UI-ÊäÈë¿òÀà[Input]·½·¨·½·¨Ð¡½á£¬½»Á÷QQȺ711841924

  2. //µÚÒ»¸ö·½·¨£º📌setText ÉèÖÃÊäÈë¿òÎı¾


  3. var input = new Input();
  4. input.setText("Hello"); // ÉèÖÃÊäÈë¿òÎı¾ÎªHello



  5. //µÚ¶þ¸ö·½·¨£º📌getText »ñÈ¡ÊäÈë¿òÎı¾


  6. var input = new Input();
  7. string currentText = input.getText(); // »ñÈ¡ÊäÈë¿òµÄÎı¾ÄÚÈÝ



  8. //µÚÈý¸ö·½·¨£º📌setlDÉèÖÿؼþID


  9. var input = new Input();
  10. input.setID("input123");
  11. //¶ÁȡʹÓÃ
  12. config.getConfig("input123");



  13. //µÚËĸö·½·¨£º📌setDefultText ÉèÖÃĬÈÏÖµ

  14. var input = new Input();
  15. input.setID("ÊäÈë¿ò1")
  16. input.setDefultText("Hello"); // ÉèÖÃÊäÈë¿òÎı¾ÎªHello



  17. //µÚÎå¸ö·½·¨£º📌setTextColorÉèÖÃÎı¾ÑÕÉ«


  18. var input = new Input();
  19. input.setTextColor(255, 0, 0); // ÉèÖÃÎı¾ÑÕɫΪºìÉ«




  20. //µÚÁù¸ö·½·¨£º📌setFontSizeÉèÖÃ×ÖÌå´óС


  21. var input = new Input();
  22. input.setFontSize(14); // ÉèÖÃ×ÖÌå´óСΪ14



  23. //µÚÆß¸ö·½·¨£º📌setBackgroundColor ÉèÖñ³¾°ÑÕÉ«

  24. var input = new Input();
  25. input.setBackgroundColor(0, 255, 0); // ÉèÖñ³¾°ÑÕɫΪÂÌÉ«





  26. //µÚ°Ë¸ö·½·¨£º📌setWidthÉèÖÃÊäÈë¿ò¿í¶È



  27. var input = new Input();
  28. input.setWidth(300); // ÉèÖÃÊäÈë¿ò¿í¶ÈΪ300



  29. //µÚ¾Å¸ö·½·¨£º📌setHeight ÉèÖÃÊäÈë¿ò¸ß¶È


  30. var input = new Input();
  31. input.setHeight(40); // ÉèÖÃÊäÈë¿ò¸ß¶ÈΪ40



  32. //µÚÊ®¸ö·½·¨£º📌setPlaceholder ÉèÖÃռλ·ûÎı¾

  33. var input = new Input();
  34. input.setPlaceholder("ÇëÊäÈëÄÚÈÝ"); // ÉèÖÃռλ·ûÎı¾Îª'ÇëÊäÈëÄÚÈÝ'



  35. //µÚʮһ¸ö·½·¨£º📌setTextAlignment ÉèÖÃÎı¾¶ÔÆë·½Ê½

  36. var input = new Input();
  37. input.setTextAlignment("center"); // ÉèÖÃÎı¾¶ÔÆë·½Ê½Îª¾ÓÖÐ


  38. //µÚÊ®¶þ¸ö·½·¨£º📌setlnputStyleÉèÖÃÊäÈë¿òÑùʽ


  39. var input = new Input();
  40. input.setInputStyle(true); // ÉèÖÃÊäÈë¿òÑùʽΪµ×²¿ÏßÌõ
¸´ÖÆ´úÂë
AIWROKÈí¼þÆ»¹ûIOSÀïµÄUI-ÊäÈë¿òÀà[Input]·½·¨Ð¡½á B2BÍøÂçÈí¼þ AIWROKÈí¼þÆ»¹ûIOSÀïµÄUI-ÊäÈë¿òÀà[Input]·½·¨Ð¡½á B2BÍøÂçÈí¼þ
📌setText ÉèÖÃÊäÈë¿òÎı¾
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÉèÖÃÊäÈë¿òµÄÏÔʾÎı¾
·½·¨Ç©Ãû
Void setText(String text)
·µ»ØÖµ
Void
²ÎÊý
-String text
£ºÒªÉèÖõÄÊäÈë¿òÎı¾ÄÚÈÝ
°¸Àý
var input = new Input();
input.setText("Hello"); // ÉèÖÃÊäÈë¿òÎı¾ÎªHello
📌getText »ñÈ¡ÊäÈë¿òÎı¾
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
»ñÈ¡µ±Ç°ÊäÈë¿òµÄÎı¾ÄÚÈÝ
·½·¨Ç©Ãû
String getText()
·µ»ØÖµ
String
²ÎÊý
ÎÞ
°¸Àý
var input = new Input();
string currentText = input.getText(); // »ñÈ¡ÊäÈë¿òµÄÎı¾ÄÚÈÝ

📌setlDÉèÖÿؼþID
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÉèÖÿؼþ ID£¬ÉèÖúó¿É×Ô¶¯±£´æÅäÖÃÐÅÏ¢
·½·¨Ç©Ãû
Void setID(String id)
·µ»ØÖµ
Void
²ÎÊý
- String id
£ºÒªÉèÖõĿؼþ ID
°¸Àý
var input = new Input();
input.setID("input123");
//¶ÁȡʹÓÃ
config.getConfig("input123");
📌setDefultText ÉèÖÃĬÈÏÖµ
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÉèÖÃÊäÈë¿òµÄĬÈÏÏÔʾÎı¾
·½·¨Ç©Ãû
Void setDefaultText(String text)
·µ»ØÖµ
Void
²ÎÊý
- String text
£ºÒªÉèÖõÄÊäÈë¿òĬÈÏÎı¾ÄÚÈÝ
°¸Àý
var input = new Input();
input.setID("ÊäÈë¿ò1")
input.setDefultText("Hello"); // ÉèÖÃÊäÈë¿òÎı¾ÎªHello
📌setTextColorÉèÖÃÎı¾ÑÕÉ«
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÉèÖÃÊäÈë¿òÎı¾µÄÑÕÉ«
·½·¨Ç©Ãû
Void setTextColor(Int32 red, Int32 green, Int32 blue)
·µ»ØÖµ
Void
²ÎÊý
- Int32 red
£ººìÉ«·ÖÁ¿£¨Í¨³£È¡Öµ·¶Î§ 0~255
£©
- Int32 green
£ºÂÌÉ«·ÖÁ¿£¨Í¨³£È¡Öµ·¶Î§ 0~255
£©
- Int32 blue
£ºÀ¶É«·ÖÁ¿£¨Í¨³£È¡Öµ·¶Î§ 0~255
£©
°¸Àý
var input = new Input();
input.setTextColor(255, 0, 0); // ÉèÖÃÎı¾ÑÕɫΪºìÉ«
📌setFontSizeÉèÖÃ×ÖÌå´óС
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÉèÖÃÊäÈë¿òÖÐÎı¾µÄ×ÖÌå´óС
·½·¨Ç©Ãû
Void setFontSize(Int32 size)
·µ»ØÖµ
Void
²ÎÊý
- Int32 size
£ºÒªÉèÖõÄ×ÖÌå´óС
°¸Àý
var input = new Input();
input.setFontSize(14); // ÉèÖÃ×ÖÌå´óСΪ14
📌setBackgroundColor ÉèÖñ³¾°ÑÕÉ«
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÉèÖÃÊäÈë¿òµÄ±³¾°ÑÕÉ«
·½·¨Ç©Ãû
Void setBackgroundColor(Int32 red, Int32 green, Int32 blue)
·µ»ØÖµ
Void
²ÎÊý
- Int32 red
£ººìÉ«·ÖÁ¿£¨Í¨³£È¡Öµ·¶Î§ 0~255
£©
- Int32 green
£ºÂÌÉ«·ÖÁ¿£¨Í¨³£È¡Öµ·¶Î§ 0~255
£©
- Int32 blue
£ºÀ¶É«·ÖÁ¿£¨Í¨³£È¡Öµ·¶Î§ 0~255
£©
°¸Àý
var input = new Input();
input.setBackgroundColor(0, 255, 0); // ÉèÖñ³¾°ÑÕɫΪÂÌÉ«
📌setWidthÉèÖÃÊäÈë¿ò¿í¶È
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÉèÖÃÊäÈë¿òµÄ¿í¶È
·½·¨Ç©Ãû
Void setWidth(Int32 width)
·µ»ØÖµ
Void
²ÎÊý
- Int32 width
£ºÒªÉèÖõÄÊäÈë¿ò¿í¶È
°¸Àý
var input = new Input();
input.setWidth(300); // ÉèÖÃÊäÈë¿ò¿í¶ÈΪ300
📌setHeight ÉèÖÃÊäÈë¿ò¸ß¶È
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÉèÖÃÊäÈë¿òµÄ¸ß¶È
·½·¨Ç©Ãû
Void setHeight(Int32 height)
·µ»ØÖµ
Void
²ÎÊý
- Int32 height
£ºÒªÉèÖõÄÊäÈë¿ò¸ß¶È
°¸Àý
var input = new Input();
input.setHeight(40); // ÉèÖÃÊäÈë¿ò¸ß¶ÈΪ40
📌setPlaceholder ÉèÖÃռλ·ûÎı¾
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÉèÖÃÊäÈë¿òµÄռλ·ûÎı¾
·½·¨Ç©Ãû
Void setPlaceholder(String text)
·µ»ØÖµ
Void
²ÎÊý
- String text
£ºÒªÉèÖõÄռλ·ûÎı¾ÄÚÈÝ
°¸Àý
var input = new Input();
input.setPlaceholder("ÇëÊäÈëÄÚÈÝ"); // ÉèÖÃռλ·ûÎı¾Îª'ÇëÊäÈëÄÚÈÝ'
📌setTextAlignment ÉèÖÃÎı¾¶ÔÆë·½Ê½
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÉèÖÃÊäÈë¿òÖÐÎÄ×ÖµÄ¶ÔÆë·½Ê½
·½·¨Ç©Ãû
Void setTextAlignment(String alignment)
·µ»ØÖµ
Void
²ÎÊý
- String alignment
£ºÎı¾¶ÔÆë·½Ê½£¨Èç center
¡¢left
¡¢right
µÈ¿Éѡֵ£©
°¸Àý
var input = new Input();
input.setTextAlignment("center"); // ÉèÖÃÎı¾¶ÔÆë·½Ê½Îª¾ÓÖÐ
📌setlnputStyleÉèÖÃÊäÈë¿òÑùʽ
Àà±ð
ÏêÇé˵Ã÷
·½·¨¹¦ÄÜ
ÉèÖÃÊäÈë¿òµÄÏÔʾÎı¾
·½·¨Ç©Ãû
Void setText(String text)
·µ»ØÖµ
Void
²ÎÊý
- String text
£ºÒªÉèÖõÄÊäÈë¿òÎı¾ÄÚÈÝ
°¸Àý
var input = new Input();
input.setInputStyle(true); // ÉèÖÃÊäÈë¿òÑùʽΪµ×²¿ÏßÌõ
ÍêÕû°¸Àý£º
  1. // 🔨UI-ÊäÈë¿òÀà[Input]·½·¨ÍêÕûʾÀý
  2. // 🍎UI-ÊäÈë¿òÀà[Input]·½·¨Ð¡½á£¬½»Á÷QQȺ711841924

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

  4. var vc = new IOSView();
  5. vc.show(() => {
  6.     printl("InputʾÀý½çÃæÒѼÓÔØ");
  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("Input¿Ø¼þÑÝʾ");
  24.     titleLabel.setFontSize(20.0);
  25.     titleLabel.setTextColor(255, 255, 255);
  26.     titleLabel.setTextAlignment("center");
  27.    
  28.     var subtitleLabel = new Label();
  29.     subtitleLabel.setText("ÊäÈë¿ò¿Ø¼þµÄʹÓ÷½·¨");
  30.     subtitleLabel.setFontSize(14.0);
  31.     subtitleLabel.setTextColor(255, 255, 255);
  32.     subtitleLabel.setTextAlignment("center");
  33.    
  34.     titleContainer.addView(titleLabel);
  35.     titleContainer.addView(subtitleLabel);
  36.     mainContainer.addView(titleContainer);
  37.    
  38.     // Input·½·¨ÑÝÊ¾ÇøÓò
  39.     var demoContainer = new Vertical();
  40.     demoContainer.setBackgroundColor(255, 255, 255);
  41.     demoContainer.setSpacing(15);
  42.    
  43.     var demoTitle = new Label();
  44.     demoTitle.setText("Input¿Ø¼þ¹¦ÄÜÑÝʾ");
  45.     demoTitle.setFontSize(16.0);
  46.     demoTitle.setTextColor(0, 0, 0);
  47.     demoTitle.setTextAlignment("center");
  48.     demoContainer.addView(demoTitle);
  49.    
  50.     // µÚÒ»¸ö·½·¨£ºsetText ÉèÖÃÊäÈë¿òÎı¾
  51.     var setTextDemo = new Vertical();
  52.     setTextDemo.setSpacing(5);
  53.    
  54.     var setTextLabel = new Label();
  55.     setTextLabel.setText("📌 setText ÉèÖÃÊäÈë¿òÎı¾");
  56.     setTextLabel.setFontSize(14.0);
  57.     setTextLabel.setTextColor(0, 122, 255);
  58.     setTextDemo.addView(setTextLabel);
  59.    
  60.     var setInput = new Input();
  61.     setInput.setText("Hello"); // ÉèÖÃÊäÈë¿òÎı¾ÎªHello
  62.     setInput.setWidth(250);
  63.     setInput.setHeight(40);
  64.     setInput.setBackgroundColor(240, 240, 240);
  65.    
  66.     setTextDemo.addView(setInput);
  67.     demoContainer.addView(setTextDemo);
  68.    
  69.     // µÚ¶þ¸ö·½·¨£ºgetText »ñÈ¡ÊäÈë¿òÎı¾
  70.     var getTextDemo = new Vertical();
  71.     getTextDemo.setSpacing(5);
  72.    
  73.     var getTextLabel = new Label();
  74.     getTextLabel.setText("📌 getText »ñÈ¡ÊäÈë¿òÎı¾");
  75.     getTextLabel.setFontSize(14.0);
  76.     getTextLabel.setTextColor(0, 122, 255);
  77.     getTextDemo.addView(getTextLabel);
  78.    
  79.     var getInput = new Input();
  80.     getInput.setPlaceholder("ÇëÊäÈëÄÚÈÝ");
  81.     getInput.setWidth(250);
  82.     getInput.setHeight(40);
  83.     getInput.setBackgroundColor(240, 240, 240);
  84.    
  85.     var getButton = new Button();
  86.     getButton.setText("»ñÈ¡Îı¾");
  87.     getButton.setColor(52, 199, 89);
  88.     getButton.setTextColor(255, 255, 255);
  89.     getButton.setWidth(80);
  90.     getButton.setHeight(40);
  91.    
  92.     getButton.onClick(() => {
  93.         var currentText = getInput.getText(); // »ñÈ¡ÊäÈë¿òµÄÎı¾ÄÚÈÝ
  94.         printl("ÊäÈë¿òÄÚÈÝ: " + currentText);
  95.         
  96.         var resultLabel = new Label();
  97.         resultLabel.setText("»ñÈ¡µ½: " + currentText);
  98.         resultLabel.setFontSize(12.0);
  99.         resultLabel.setTextColor(52, 199, 89);
  100.         getTextDemo.addView(resultLabel);
  101.     });
  102.    
  103.     var getTextContainer = new Horizontal();
  104.     getTextContainer.setSpacing(10);
  105.     getTextContainer.addView(getInput);
  106.     getTextContainer.addView(getButton);
  107.    
  108.     getTextDemo.addView(getTextContainer);
  109.     demoContainer.addView(getTextDemo);
  110.    
  111.     // µÚÈý¸ö·½·¨ºÍµÚËĸö·½·¨£ºsetID ºÍ setDefultText
  112.     var idDefaultDemo = new Vertical();
  113.     idDefaultDemo.setSpacing(5);
  114.    
  115.     var idDefaultLabel = new Label();
  116.     idDefaultLabel.setText("📌 setID ºÍ setDefultText");
  117.     idDefaultLabel.setFontSize(14.0);
  118.     idDefaultLabel.setTextColor(0, 122, 255);
  119.     idDefaultDemo.addView(idDefaultLabel);
  120.    
  121.     var idInput = new Input();
  122.     idInput.setID("ÊäÈë¿ò1");
  123.     idInput.setDefultText("Hello"); // ÉèÖÃÊäÈë¿òĬÈÏÎı¾ÎªHello
  124.     idInput.setWidth(250);
  125.     idInput.setHeight(40);
  126.     idInput.setBackgroundColor(240, 240, 240);
  127.    
  128.     var idButton = new Button();
  129.     idButton.setText("¶ÁÈ¡ÅäÖÃ");
  130.     idButton.setColor(255, 149, 0);
  131.     idButton.setTextColor(255, 255, 255);
  132.     idButton.setWidth(80);
  133.     idButton.setHeight(40);
  134.    
  135.     idButton.onClick(() => {
  136.         var savedConfig = config.getConfig("ÊäÈë¿ò1");
  137.         printl("±£´æµÄÅäÖÃ: " + savedConfig);
  138.         
  139.         var resultLabel = new Label();
  140.         resultLabel.setText("ÅäÖÃÖµ: " + savedConfig);
  141.         resultLabel.setFontSize(12.0);
  142.         resultLabel.setTextColor(255, 149, 0);
  143.         idDefaultDemo.addView(resultLabel);
  144.     });
  145.    
  146.     var idContainer = new Horizontal();
  147.     idContainer.setSpacing(10);
  148.     idContainer.addView(idInput);
  149.     idContainer.addView(idButton);
  150.    
  151.     idDefaultDemo.addView(idContainer);
  152.     demoContainer.addView(idDefaultDemo);
  153.    
  154.     // µÚÎå¸ö·½·¨£ºsetTextColorÉèÖÃÎı¾ÑÕÉ«
  155.     var textColorDemo = new Vertical();
  156.     textColorDemo.setSpacing(5);
  157.    
  158.     var textColorLabel = new Label();
  159.     textColorLabel.setText("📌 setTextColorÉèÖÃÎı¾ÑÕÉ«");
  160.     textColorLabel.setFontSize(14.0);
  161.     textColorLabel.setTextColor(0, 122, 255);
  162.     textColorDemo.addView(textColorLabel);
  163.    
  164.     var colorInput = new Input();
  165.     colorInput.setPlaceholder("ºìÉ«Îı¾ÊäÈë¿ò");
  166.     colorInput.setTextColor(255, 0, 0); // ÉèÖÃÎı¾ÑÕɫΪºìÉ«
  167.     colorInput.setWidth(250);
  168.     colorInput.setHeight(40);
  169.     colorInput.setBackgroundColor(240, 240, 240);
  170.    
  171.     textColorDemo.addView(colorInput);
  172.     demoContainer.addView(textColorDemo);
  173.    
  174.     // µÚÁù¸ö·½·¨£ºsetFontSizeÉèÖÃ×ÖÌå´óС
  175.     var fontSizeDemo = new Vertical();
  176.     fontSizeDemo.setSpacing(5);
  177.    
  178.     var fontSizeLabel = new Label();
  179.     fontSizeLabel.setText("📌 setFontSizeÉèÖÃ×ÖÌå´óС");
  180.     fontSizeLabel.setFontSize(14.0);
  181.     fontSizeLabel.setTextColor(0, 122, 255);
  182.     fontSizeDemo.addView(fontSizeLabel);
  183.    
  184.     var sizeInput = new Input();
  185.     sizeInput.setPlaceholder("´ó×ÖÌåÊäÈë¿ò");
  186.     sizeInput.setFontSize(18); // ÉèÖÃ×ÖÌå´óСΪ18
  187.     sizeInput.setWidth(250);
  188.     sizeInput.setHeight(40);
  189.     sizeInput.setBackgroundColor(240, 240, 240);
  190.    
  191.     fontSizeDemo.addView(sizeInput);
  192.     demoContainer.addView(fontSizeDemo);
  193.    
  194.     // µÚÆß¸ö·½·¨£ºsetBackgroundColor ÉèÖñ³¾°ÑÕÉ«
  195.     var bgColorDemo = new Vertical();
  196.     bgColorDemo.setSpacing(5);
  197.    
  198.     var bgColorLabel = new Label();
  199.     bgColorLabel.setText("📌 setBackgroundColorÉèÖñ³¾°ÑÕÉ«");
  200.     bgColorLabel.setFontSize(14.0);
  201.     bgColorLabel.setTextColor(0, 122, 255);
  202.     bgColorDemo.addView(bgColorLabel);
  203.    
  204.     var bgInput = new Input();
  205.     bgInput.setPlaceholder("ÂÌÉ«±³¾°ÊäÈë¿ò");
  206.     bgInput.setBackgroundColor(144, 238, 144); // ÉèÖñ³¾°ÑÕɫΪdzÂÌÉ«
  207.     bgInput.setWidth(250);
  208.     bgInput.setHeight(40);
  209.    
  210.     bgColorDemo.addView(bgInput);
  211.     demoContainer.addView(bgColorDemo);
  212.    
  213.     // µÚ°Ë¸öºÍµÚ¾Å¸ö·½·¨£ºsetWidth ºÍ setHeight
  214.     var sizeDemo = new Vertical();
  215.     sizeDemo.setSpacing(5);
  216.    
  217.     var sizeLabel = new Label();
  218.     sizeLabel.setText("📌 setWidth ºÍ setHeight");
  219.     sizeLabel.setFontSize(14.0);
  220.     sizeLabel.setTextColor(0, 122, 255);
  221.     sizeDemo.addView(sizeLabel);
  222.    
  223.     var sizeInput = new Input();
  224.     sizeInput.setPlaceholder("×Ô¶¨Òå³ß´çÊäÈë¿ò");
  225.     sizeInput.setWidth(300); // ÉèÖÃÊäÈë¿ò¿í¶ÈΪ300
  226.     sizeInput.setHeight(50); // ÉèÖÃÊäÈë¿ò¸ß¶ÈΪ50
  227.     sizeInput.setBackgroundColor(240, 240, 240);
  228.    
  229.     sizeDemo.addView(sizeInput);
  230.     demoContainer.addView(sizeDemo);
  231.    
  232.     // µÚÊ®¸ö·½·¨£ºsetPlaceholder ÉèÖÃռλ·ûÎı¾
  233.     var placeholderDemo = new Vertical();
  234.     placeholderDemo.setSpacing(5);
  235.    
  236.     var placeholderLabel = new Label();
  237.     placeholderLabel.setText("📌 setPlaceholder ÉèÖÃռλ·ûÎı¾");
  238.     placeholderLabel.setFontSize(14.0);
  239.     placeholderLabel.setTextColor(0, 122, 255);
  240.     placeholderDemo.addView(placeholderLabel);
  241.    
  242.     var placeholderInput = new Input();
  243.     placeholderInput.setPlaceholder("ÇëÊäÈëÄÚÈÝ"); // ÉèÖÃռλ·ûÎı¾Îª'ÇëÊäÈëÄÚÈÝ'
  244.     placeholderInput.setWidth(250);
  245.     placeholderInput.setHeight(40);
  246.     placeholderInput.setBackgroundColor(240, 240, 240);
  247.    
  248.     placeholderDemo.addView(placeholderInput);
  249.     demoContainer.addView(placeholderDemo);
  250.    
  251.     // µÚʮһ¸ö·½·¨£ºsetTextAlignment ÉèÖÃÎı¾¶ÔÆë·½Ê½
  252.     var alignmentDemo = new Vertical();
  253.     alignmentDemo.setSpacing(5);
  254.    
  255.     var alignmentLabel = new Label();
  256.     alignmentLabel.setText("📌 setTextAlignment ÉèÖÃÎı¾¶ÔÆë·½Ê½");
  257.     alignmentLabel.setFontSize(14.0);
  258.     alignmentLabel.setTextColor(0, 122, 255);
  259.     alignmentDemo.addView(alignmentLabel);
  260.    
  261.     var leftInput = new Input();
  262.     leftInput.setPlaceholder("×ó¶ÔÆë");
  263.     leftInput.setTextAlignment("left"); // ÉèÖÃÎı¾¶ÔÆë·½Ê½Îª×ó¶ÔÆë
  264.     leftInput.setWidth(250);
  265.     leftInput.setHeight(40);
  266.     leftInput.setBackgroundColor(240, 240, 240);
  267.    
  268.     var centerInput = new Input();
  269.     centerInput.setPlaceholder("¾ÓÖÐ¶ÔÆë");
  270.     centerInput.setTextAlignment("center"); // ÉèÖÃÎı¾¶ÔÆë·½Ê½Îª¾ÓÖÐ
  271.     centerInput.setWidth(250);
  272.     centerInput.setHeight(40);
  273.     centerInput.setBackgroundColor(240, 240, 240);
  274.    
  275.     var rightInput = new Input();
  276.     rightInput.setPlaceholder("ÓÒ¶ÔÆë");
  277.     rightInput.setTextAlignment("right"); // ÉèÖÃÎı¾¶ÔÆë·½Ê½ÎªÓÒ¶ÔÆë
  278.     rightInput.setWidth(250);
  279.     rightInput.setHeight(40);
  280.     rightInput.setBackgroundColor(240, 240, 240);
  281.    
  282.     alignmentDemo.addView(leftInput);
  283.     alignmentDemo.addView(centerInput);
  284.     alignmentDemo.addView(rightInput);
  285.     demoContainer.addView(alignmentDemo);
  286.    
  287.     // µÚÊ®¶þ¸ö·½·¨£ºsetInputStyleÉèÖÃÊäÈë¿òÑùʽ
  288.     var styleDemo = new Vertical();
  289.     styleDemo.setSpacing(5);
  290.    
  291.     var styleLabel = new Label();
  292.     styleLabel.setText("📌 setInputStyleÉèÖÃÊäÈë¿òÑùʽ");
  293.     styleLabel.setFontSize(14.0);
  294.     styleLabel.setTextColor(0, 122, 255);
  295.     styleDemo.addView(styleLabel);
  296.    
  297.     var styleInput = new Input();
  298.     styleInput.setPlaceholder("µ×²¿ÏßÌõÑùʽ");
  299.     styleInput.setInputStyle(true); // ÉèÖÃÊäÈë¿òÑùʽΪµ×²¿ÏßÌõ
  300.     styleInput.setWidth(250);
  301.     styleInput.setHeight(40);
  302.    
  303.     styleDemo.addView(styleInput);
  304.     demoContainer.addView(styleDemo);
  305.    
  306.     mainContainer.addView(demoContainer);
  307.    
  308.     // ʵ¼ÊÓ¦ÓÃʾÀý
  309.     var applicationContainer = new Vertical();
  310.     applicationContainer.setBackgroundColor(255, 255, 255);
  311.     applicationContainer.setSpacing(15);
  312.    
  313.     var appTitle = new Label();
  314.     appTitle.setText("Inputʵ¼ÊÓ¦ÓÃʾÀý");
  315.     appTitle.setFontSize(16.0);
  316.     appTitle.setTextColor(0, 0, 0);
  317.     appTitle.setTextAlignment("center");
  318.     applicationContainer.addView(appTitle);
  319.    
  320.     // Óû§ÃûÊäÈë
  321.     var usernameContainer = new Vertical();
  322.     usernameContainer.setSpacing(5);
  323.    
  324.     var usernameLabel = new Label();
  325.     usernameLabel.setText("Óû§Ãû:");
  326.     usernameLabel.setFontSize(14.0);
  327.     usernameLabel.setTextColor(0, 0, 0);
  328.     usernameContainer.addView(usernameLabel);
  329.    
  330.     var usernameInput = new Input();
  331.     usernameInput.setPlaceholder("ÇëÊäÈëÓû§Ãû");
  332.     usernameInput.setWidth(250);
  333.     usernameInput.setHeight(40);
  334.     usernameInput.setBackgroundColor(240, 240, 240);
  335.     usernameContainer.addView(usernameInput);
  336.     applicationContainer.addView(usernameContainer);
  337.    
  338.     // ÃÜÂëÊäÈë
  339.     var passwordContainer = new Vertical();
  340.     passwordContainer.setSpacing(5);
  341.    
  342.     var passwordLabel = new Label();
  343.     passwordLabel.setText("ÃÜÂë:");
  344.     passwordLabel.setFontSize(14.0);
  345.     passwordLabel.setTextColor(0, 0, 0);
  346.     passwordContainer.addView(passwordLabel);
  347.    
  348.     var passwordInput = new Input();
  349.     passwordInput.setPlaceholder("ÇëÊäÈëÃÜÂë");
  350.     passwordInput.setWidth(250);
  351.     passwordInput.setHeight(40);
  352.     passwordInput.setBackgroundColor(240, 240, 240);
  353.     passwordInput.setInputStyle(true); // µ×²¿ÏßÌõÑùʽ
  354.     passwordContainer.addView(passwordInput);
  355.     applicationContainer.addView(passwordContainer);
  356.    
  357.     // °´Å¥ÇøÓò
  358.     var buttonContainer = new Horizontal();
  359.     buttonContainer.setSpacing(10);
  360.     buttonContainer.setAlignment("center");
  361.    
  362.     var submitBtn = new Button();
  363.     submitBtn.setText("Ìá½»");
  364.     submitBtn.setColor(0, 122, 255);
  365.     submitBtn.setTextColor(255, 255, 255);
  366.     submitBtn.setWidth(100);
  367.     submitBtn.setHeight(40);
  368.    
  369.     submitBtn.onClick(() => {
  370.         var username = usernameInput.getText();
  371.         var password = passwordInput.getText();
  372.         printl("Óû§Ãû: " + username);
  373.         printl("ÃÜÂë: " + password);
  374.         
  375.         var resultLabel = new Label();
  376.         resultLabel.setText("Ìá½»³É¹¦£¡Óû§Ãû: " + username);
  377.         resultLabel.setFontSize(12.0);
  378.         resultLabel.setTextColor(52, 199, 89);
  379.         applicationContainer.addView(resultLabel);
  380.     });
  381.    
  382.     var resetBtn = new Button();
  383.     resetBtn.setText("ÖØÖÃ");
  384.     resetBtn.setColor(255, 149, 0);
  385.     resetBtn.setTextColor(255, 255, 255);
  386.     resetBtn.setWidth(100);
  387.     resetBtn.setHeight(40);
  388.    
  389.     resetBtn.onClick(() => {
  390.         usernameInput.setText("");
  391.         passwordInput.setText("");
  392.         printl("ÊäÈë¿òÒÑÖØÖÃ");
  393.     });
  394.    
  395.     buttonContainer.addView(submitBtn);
  396.     buttonContainer.addView(resetBtn);
  397.     applicationContainer.addView(buttonContainer);
  398.     mainContainer.addView(applicationContainer);
  399.    
  400.     // ¿Ø¼þÐÅÏ¢ÇøÓò
  401.     var infoContainer = new Vertical();
  402.     infoContainer.setBackgroundColor(236, 245, 255);
  403.     infoContainer.setSpacing(8);
  404.    
  405.     var infoTitle = new Label();
  406.     infoTitle.setText("ℹ️ Input¿Ø¼þ˵Ã÷");
  407.     infoTitle.setFontSize(16.0);
  408.     infoTitle.setTextColor(0, 122, 255);
  409.     infoContainer.addView(infoTitle);
  410.    
  411.     var info1 = new Label();
  412.     info1.setText("• Input¿Ø¼þÓÃÓÚ½ÓÊÕÓû§ÊäÈë");
  413.     info1.setFontSize(12.0);
  414.     info1.setTextColor(52, 58, 64);
  415.     infoContainer.addView(info1);
  416.    
  417.     var info2 = new Label();
  418.     info2.setText("• Ö§³ÖÎı¾ÉèÖᢻñÈ¡ºÍÑùʽ¶¨ÖÆ");
  419.     info2.setFontSize(12.0);
  420.     info2.setTextColor(52, 58, 64);
  421.     infoContainer.addView(info2);
  422.    
  423.     var info3 = new Label();
  424.     info3.setText("• ¿Éͨ¹ýsetID±£´æºÍ¶ÁÈ¡ÅäÖÃ");
  425.     info3.setFontSize(12.0);
  426.     info3.setTextColor(52, 58, 64);
  427.     infoContainer.addView(info3);
  428.    
  429.     mainContainer.addView(infoContainer);
  430.    
  431.     // µ×²¿°´Å¥
  432.     var bottomContainer = new Horizontal();
  433.     bottomContainer.setSpacing(10);
  434.     bottomContainer.setAlignment("center");
  435.    
  436.     var exitBtn = new Button();
  437.     exitBtn.setText("Í˳öʾÀý");
  438.     exitBtn.setColor(255, 59, 48);
  439.     exitBtn.setTextColor(255, 255, 255);
  440.     exitBtn.setHeight(40);
  441.    
  442.     exitBtn.onClick(() => {
  443.         printl("Í˳ö°´Å¥±»µã»÷");
  444.         vc.dismiss();
  445.     });
  446.    
  447.     bottomContainer.addView(exitBtn);
  448.     mainContainer.addView(bottomContainer);
  449.    
  450.     // Ìí¼Óµ½Ö÷ÊÓͼ
  451.     view.addView(mainContainer);
  452.    
  453.     printl("InputʾÀý½çÃæ¹¹½¨Íê³É");
  454. });

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



»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

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

¹Ø±Õ

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

map2

GMT+8, 2025-8-7 01:07 , Processed in 0.148898 second(s), 36 queries .

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