我已经有了按钮:
<Button
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:drawableLeft="@drawable/empty"
android:id="@+id/buttonMyText"
android:text=" myText"
android:textSize="20px"
android:gravity="left">
</Button>
Run Code Online (Sandbox Code Playgroud)
程序启动时,我在按钮上显示"空"图标.
我想要做的是根据用户输入从我的代码(低,中和高)自动更改按钮的图标
我试过了:
Button myButton = bla... bla... bla...
Run Code Online (Sandbox Code Playgroud)
但我无法弄清楚
myButton.(what?)
Run Code Online (Sandbox Code Playgroud) 我期望下面两个脚本的输出相同.
但是当我执行脚本1时,我没有在按钮上获得图像.但是,脚本2运行良好.
脚本1
from Tkinter import *
class fe:
def __init__(self,master):
self.b=Button(master,justify = LEFT)
photo=PhotoImage(file="mine32.gif")
self.b.config(image=photo,width="10",height="10")
self.b.pack(side=LEFT)
root = Tk()
front_end=fe(root)
root.mainloop()
Run Code Online (Sandbox Code Playgroud)
脚本2
from Tkinter import *
root=Tk()
b=Button(root,justify = LEFT)
photo=PhotoImage(file="mine32.gif")
b.config(image=photo,width="10",height="10")
b.pack(side=LEFT)
root.mainloop()
Run Code Online (Sandbox Code Playgroud) 在我一直在努力的应用程序中,我希望有一个多状态(在我的情况下,三个)切换按钮,而不是提供的两个ToggleButton.我已经尝试Button按照CompoundButton源代码开始扩展自己,但老实说,阅读它的来源有点压倒性.
有没有办法只使用选择器xml或其他东西做一个三态切换按钮,或者可能是另一种我没想过的方法?我不知道该怎么做.
我有一张表格.7垂直布局中的EditText.在一瞬间屏幕上只能看到3个EditText(形式很大所以我需要向上和向下滚动以填充所有文件).在底部 - 按钮.
当我填充顶部EditText(或顶部之一,当我向下滚动到按钮时看不见),并在此EditText中聚焦(光标),当我向下滚动并尝试单击按钮一次时 - 没有任何反应.当我再次点击时 - 发生按钮动作.
当具有焦点和按钮的EditText都可见时 - 按钮需要单击一下.
我认为在第一种情况下,第一次点击只需要关注.第二次点击是"真实"点击.
我怎么解决它?我只需要点击一下Button.谢谢
如何使用twitter bootstrap创建重置按钮?与表单重置按钮相同,清除所有数据?
我在高级图表中有一个很好的图表,用户可以放大.我真的不喜欢内置的ZOOM RESET按钮,并希望将我自己的自定义缩放重置按钮添加到已存在的导航栏中.
所以我的问题是:1.有没有办法隐藏默认的highcharts ZOOM RESET按钮?2.我可以调用一个方法/函数来执行ZOOM RESET吗?(我可以通过我自己的按钮点击来调用它)
当我在按钮元素内绑定span元素的click事件时,我遇到了Firefox 32的问题.其他浏览器似乎运行良好.
<span onClick="alert('test');">**Working**</span><br>
<button>inside a button <span onClick="alert('test');">**Not working**</span></button>Run Code Online (Sandbox Code Playgroud)
有人知道为什么,如果它是一个错误或功能?
我有以下样式的按钮
button {
background: none;
border-color: #87db41;
color: #87db41;
padding: 5px 5px;
width: 30%;
text-align: center;
&: active {
border-color: @aviata-color;
}
}Run Code Online (Sandbox Code Playgroud)
<button>Subscribe</button>Run Code Online (Sandbox Code Playgroud)
我想删除'按钮'3D效果.我怎样才能做到这一点?如果它有帮助我也在我的网站上使用bootstrap
我试图改变我的按钮的背景颜色,但似乎没有任何工作,我尝试了凸起的属性,也许我错误地使用它.你们有没有想法?
import React from 'react';
import { StyleSheet, Text, View, Button, TouchableHighlight } from 'react-native';
export default class App extends React.Component {
state={
name: "Mamadou"
};
myPress = () => {
this.setState({
name: "Coulibaly"
});
};
render() {
return (
<View style={styles.container}>
<Button
title={this.state.name}
color="red"
onPress={this.myPress}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Run Code Online (Sandbox Code Playgroud) 如何更改材质按钮的字体大小...有更好的方法吗?
new MaterialButton(
height: 140.0,
minWidth: double.infinity,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
child: new Text("material button"),
onPressed: () => {},
splashColor: Colors.redAccent,
),
Run Code Online (Sandbox Code Playgroud) button ×10
android ×3
javascript ×2
click ×1
css ×1
dom-events ×1
firefox ×1
flutter ×1
focus ×1
forms ×1
highcharts ×1
html ×1
icons ×1
image ×1
layout ×1
onclick ×1
python ×1
react-native ×1
reactjs ×1
reset ×1
text ×1
text-size ×1
tkinter ×1
togglebutton ×1
zoom ×1