更改FlatButton图标大小

时间:2016-08-02 08:33:42

标签: reactjs material-design material-ui

我正在构建react material-ui虚拟(屏幕上)键盘。而且我很难实现密钥大小的未来。我正在使用FlatButtton当我使用标签来显示符号键时,我想办法改变label的大小但我还没有找到改变方法{{}使用iconicon时的大小。我尝试使用SvgIconlabel但看起来不像文字labelStyle那样时尚。

Screenshot

以下是我更改label尺寸的方式:

label

代码仅用于开发,我完成后的想法是删除let theme: MuiTheme = getMuiTheme(); theme.button.height += 10; theme.button.minWidth += 10; theme.flatButton.fontSize += 10; return ( <MuiThemeProvider muiTheme={theme}> <div> <link href="https://fonts.googleapis.com/css?family=Roboto:400,300,500" rel="stylesheet" type="text/css"/> <Keyboard textField={textField} open={this.state.open} onRequestClose={this._onRequestClose} onInput={this._onInput} layout={[AlphaNumericKeyboard]} /> </div> </MuiThemeProvider> ); link并将div替换为getMuiTheme()和{{1使用this.context.muiTheme

这是我用来更改+= 10尺寸的代码:

= this.props.keySize

iconReact.cloneElement(icon, {style: {width: 34, height: 34}});但我render使用icon

总是大小为24x24。我已尝试使用render,但仍然没有结果。

我已经开始浏览<FlatButton icon={React.cloneElement(icon, {style: {width: 34, height: 34}})} />;的源代码,但仍未找到改变其大小的方法。

这是我尝试过的最后一次尝试,因为我发现FlatButton剂量变化theme.button.iconButtonSize += 10;material-ui并且认为空间不够,但仍有42x42空间空白且此剂量没有帮助......

margin

有没有办法在使用padding时更改const noStyl: React.CSSProperties = { marginLeft: 0, marginRight: 0, paddingLeft: 0, paddingRight: 0 }; keyboardKey = <FlatButton icon={React.cloneElement(icon, {style: {width: 34, height: 34}})} labelStyle={noStyl} />; 的尺寸?

1 个答案:

答案 0 :(得分:0)

截至v0.15.2 icon style prop已被覆盖(无法从icon / {{1 FlatButton设置样式RiasedButton }}

相关问题