import tkinter as tk
class Header(tk.Frame):
def __init__(self, master):
master.title("Header")
frame = tk.Frame(master, bg='green')
frame.pack(fill=tk.X, ipadx=20)
heading = tk.Label(frame, text = 'Heading', bg="green")
heading.pack(side=tk.LEFT, anchor=tk.N)
line1_header = tk.Label(frame, text='Paragraph', bg='green')
line1_header.pack(side=tk.LEFT, anchor=tk.N)
root=tk.Tk()
app = Header(root)
root.mainloop()
如何在tkinter中将这两个标签相互堆叠?当前正在发生的是彼此相邻。
预先感谢:)