javascript - 输入字段内的按钮 Sencha Touch 2.0

标签 javascript sencha-touch-2

我试图实现的是这样的: enter image description here
只有在 Sencha Touch 应用程序中。 我实现了一个输入字段,旁边有一个按钮,但输入字段内没有按钮。
有没有办法在 Sencha Touch 2 中获得此功能? (不使用 css 将按钮 float 在输入上方。

最佳答案

你可以做到这一点,让我们试试:

{
    xtype: 'textfield',
    component: {
      xtype: 'container', 
      layout: 'hbox', 
      items: [
      {
        xtype: 'textfield', 
        flex: 3,
      }, 
      {
        xtype: 'button', 
        flex: 1, 
        text: 'test'
      }
      ]},
},

说明:组件是输入框的特殊配置,默认设置为{xtype: "input", type: "text"} ,这是此解决方法的关键。使用 flex config

缩放您的 textfieldbutton 宽度

希望对您有所帮助。 :)

关于javascript - 输入字段内的按钮 Sencha Touch 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10119021/

相关文章:

javascript - setState 没有更新 DOM

javascript - 如何在 odometer.js 中的数字之前添加文本

sencha-touch-2 - 当应用程序部署在设备上时,如何在 sencha touch 上运行?

extjs - 从另一个商店访问一个商店 - Sencha Touch

javascript - 使用 Node pg 选择当前值后如何增加 postgres 表列?

javascript - 更改 MSCRM 2011 子网格实体

sencha-touch-2 - Sencha Touch 2、嵌套XML解析nodeValue

html - Sencha 触摸 2 : How to handle custom css files while production build?

google-maps - Sencha 触摸2 : map marker titles

BlogSpot 中的 JavaScript/Jquery 在移动浏览器中不工作