import ttkbootstrap as ttk
from ttkbootstrap.constants import *
# import tkinter
# import turtle
root = ttk.Window(title="My Application")
root.geometry('200x100')
Label1=ttk.Label(root,text="海龟绘图仪2.0",bootstyle="primary",font="幼圆,30")
Label1.pack()
#------------------------------------------------------------------------------
button1=ttk.Button(root,text="th",bootstyle="primary-success",width=5)
button1.place(relx=1,rely=1,anchor='se')
#------------------------------------------------------------------------------
button2=ttk.Button(root,text="th",bootstyle="primary-success",width=5)
button2.place(relx=0,rely=1,anchor='se')
root.mainloop()
运行正常,但只有一个按钮被显示出来,本来有两个的
对照了之前运行成功的代码,同时检查了语法错误,但没有发现异常
运行后出现两个按钮
button2 anchor改成sw左下对齐 se是右下对齐 你两个弄成一样都重叠了
import ttkbootstrap as ttk
from ttkbootstrap.constants import *
# import tkinter
# import turtle
root = ttk.Window(title="My Application")
root.geometry('200x100')
Label1 = ttk.Label(root, text="海龟绘图仪2.0", bootstyle="primary", font="幼圆,30")
Label1.pack()
# ------------------------------------------------------------------------------
button1 = ttk.Button(root, text="th", bootstyle="primary-success", width=5)
button1.place(relx=1, rely=1, anchor='se')
# ------------------------------------------------------------------------------
button2 = ttk.Button(root, text="th", bootstyle="primary-success", width=5)
button2.place(relx=0, rely=1, anchor='sw')
root.mainloop()