草庐IT

tkinter-button

全部标签

button - 如何更改 flutter Material 按钮的字体大小?

如何更改Material按钮的字体大小...有更好的方法吗?newMaterialButton(height:140.0,minWidth:double.infinity,color:Theme.of(context).primaryColor,textColor:Colors.white,child:newText("materialbutton"),onPressed:()=>{},splashColor:Colors.redAccent,), 最佳答案 Flutter中的小部件架构使这变得非常简单:MaterialButton

安卓 : change button text and background color

如何在按下按钮时使用xml更改文本和背景颜色?我可以改变文字颜色:我可以改变背景(在带有可绘制引用的选择器/项目中使用它):但是我怎样才能做到这两点呢?假设我想要:默认:黑色文字/白色背景按下:白色文字/蓝色背景编辑:回答我完全忘记了背景和文本颜色是分开管理的,所以我就是这样做的:在mybackgroundcolors.xml我管理背景,在filtersbuttoncolors.xml我管理文本颜色。在两个xml文件中,我管理状态(按下、选中、默认) 最佳答案 从API级别21开始,您可以使用:android:backgroundT

android - Button with image, ImageButton, and clickable ImageView的区别?

Buttonwithimage,ImageButton和clickableImageView有什么区别吗? 最佳答案 这可能只涵盖了部分差异,实际查看Android源代码树以了解发生了什么会有所帮助。ImageButtons具有推送状态,而可点击图像则没有。你也不能为ImageButton调用setText,你可以用一个普通的按钮。它们都来自View,但查看以下扩展链可能会有所帮助。java.lang.Object↳android.view.View↳android.widget.ImageView↳android.widget.I

android - 检索项目 : No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored' 的父项时出错

我在androidstudio中启动新项目时收到这些错误。Error:(1)Errorretrievingparentforitem:Noresourcefoundthatmatchesthegivenname'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.Error:(1)Errorretrievingparentforitem:Noresourcefoundthatmatchesthegivenname'android:TextAppearance.Material.Widget.Button.B

android - 如何同时为 Button 应用形状和选择器?

我为按钮应用了一个形状,例如:现在我想使用如下选择器:对于这个按钮也是如此。有没有可能……??? 最佳答案 这样使用:........................... 关于android-如何同时为Button应用形状和选择器?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/7606995/

android - 为什么我的 Button 文本在 Lollipop 上强制全部大写?

在我的应用“TideNowWA”中,我最近使用它测试了兼容性新的Nexus9平板电脑(Lollipop-API21)。它会写一些按钮文本。此应用程序使用Android2.3和Android正确写入文本4.0。IE。混合大写和小写字母。当我的Nexus9上运行相同的应用程序时,所有字母文中大写。FWIW我的list包含以下语句:uses-sdkandroid:minSdkVersion="10"android:targetSdkVersion="14"我可以在我的代码中修复这个问题还是操作系统中的错误?谢谢 最佳答案 我不知道为什么会

基于Python+Tkinter GUI 的模式识别水果分类小程序

 采用Python语言编写,并结合TkinterGUI工具制作交互式小程序开发,实现了简单的水果的边缘提取和分类。如图1-A,用户可以自定义选择路径并输出,同时可以在对话框中输入/输出结果,如图1-B。A界面展示B交互展示 图1TkinterGUI展示技术路线本次课程实践一整体设计分为三个部分:利用Python实现图像处理的基础功能利用Python实现图像二值化并提取边缘利用①中的波谱信息以及②中处理后的边缘特征对水果进行分类图2技术路线图 一、界面设计部分         利用python中的tkinterGUI进行交互式设计def__init__(self,master,entry,ent

python - 如何将参数传递给 Tkinter 中的 Button 命令?

假设我在Python中使用Tkinter制作了以下Button:importTkinterasTkwin=Tk.Toplevel()frame=Tk.Frame(master=win).grid(row=1,column=1)button=Tk.Button(master=frame,text='press',command=action)当我按下按钮时会调用方法action,但是如果我想将一些参数传递给方法action怎么办?我已尝试使用以下代码:button=Tk.Button(master=frame,text='press',command=action(someNumber)

python - 导入错误 : No module named 'Tkinter'

由于某种原因,我不能使用Tkinter或tkinter模块。在pythonshell中运行以下命令后importTkinter或importtkinter我收到了这个错误ModuleNotFoundError:Nomodulenamed'Tkinter'或ModuleNotFoundError:Nomodulenamed'tkinter'可能是什么原因,我们该如何解决? 最佳答案 您可能需要使用类似于以下内容的方式安装它:对于Ubuntu或其他带有Apt的发行版:sudoapt-getinstallpython3-tk对于Fedor

python - _tkinter.TclError : no display name and no $DISPLAY environment variable

我正在服务器中运行一个简单的python脚本:importmatplotlib.pyplotaspltimportnumpyasnpx=np.random.randn(60)y=np.random.randn(60)plt.scatter(x,y,s=20)out_png='path/to/store/out_file.png'plt.savefig(out_png,dpi=150)我尝试在安装了matplotlib1.5.1的服务器中使用命令pythonexample.py失败并出现错误:Traceback(mostrecentcalllast):File"example.py",l