0
我有一個框架,即在row = 0
,其中包含文本High
和Low
我想在column = 2
& column = 3
。我在它下面有另一行,它包含一個數值。但是在標籤上,我將寬度設置爲全部等於7.即使寬度相同,爲什麼我的標籤尺寸不同?
我在這裏做錯了什麼?
##Forecast Frame
self.ForecastFrame = Frame(self, bg='black')
self.ForecastFrame.grid(row = 0, column = 0)
##Forecast Title
self.forecastTitle = Frame(self.ForecastFrame, bg='white')
self.forecastTitle.grid(row = 0, column = 0, sticky = E)
self.forecastTitleHighLabel = Label(self.forecastTitle, text='High', font=('HelveticaNeue Light', 12), fg='white', bg='green', width = '7', anchor='center')
self.forecastTitleHighLabel.grid(row = 0, column = 2, sticky = E)
self.forecastTitleLowLabel = Label(self.forecastTitle, text='Low', font=('HelveticaNeue Light', 12), fg='white', bg='blue', width = '7', anchor='center')
self.forecastTitleLowLabel.grid(row = 0, column = 3, sticky = E)
##Forecast One Labels
self.forecastOneDate = ''
self.forecastOneIcon = ''
self.forecastOneHigh = ''
self.forecastOneLow = ''
self.forecastOne = Frame(self.ForecastFrame, bg='black')
self.forecastOne.grid(row = 1, column = 0)
self.forecastOneDateLabel = Label(self.forecastOne, font=('HelveticaNeue Light', 12), fg='white', bg='yellow', width=10, anchor='w')
self.forecastOneDateLabel.grid(row = 0, column = 0, sticky = W)
self.forecastOneIconLabel = Label(self.forecastOne, bg='red', width=50)
self.forecastOneIconLabel.grid(row = 0, column = 1, sticky = W)
self.forecastOneHighLabel = Label(self.forecastOne, font=('HelveticaNeue Light', 12, 'bold'), fg='white', bg='blue', width = '7', anchor='center')
self.forecastOneHighLabel.grid(row = 0, column = 2, sticky = E)
self.forecastOneLowLabel = Label(self.forecastOne, font=('HelveticaNeue Light', 12, 'bold'), fg='white', bg='green', width = '7', anchor='center')
self.forecastOneLowLabel.grid(row = 0, column = 3, sticky = E)
請閱讀[如何創建一個最小的,完整的,並且可驗證示例](http://www.stackoverflow.com/help/mcve)(MCVE) –
嘗試設置'粘= EW'將標籤的寬度對齊在同一列中。 – acw1668