當前位置: 首頁>>代碼示例>>Python>>正文


Python relativelayout.RelativeLayout方法代碼示例

本文整理匯總了Python中kivy.uix.relativelayout.RelativeLayout方法的典型用法代碼示例。如果您正苦於以下問題:Python relativelayout.RelativeLayout方法的具體用法?Python relativelayout.RelativeLayout怎麽用?Python relativelayout.RelativeLayout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在kivy.uix.relativelayout的用法示例。


在下文中一共展示了relativelayout.RelativeLayout方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: on_parent

# 需要導入模塊: from kivy.uix import relativelayout [as 別名]
# 或者: from kivy.uix.relativelayout import RelativeLayout [as 別名]
def on_parent(self, instance, value):
		if value is None:
			pass
		elif issubclass(value.__class__, RelativeLayout) or value == Window:
			self.y = 0
			if self.side == 'left':
				self.x = -self.nav_width
			else:
				self.x = value.width
		else:
			self.y = value.y
			if self.side == 'left':
				self.x = value.x - self.nav_width
			else:
				self.x = value.x + value.width
		self._initial_x = self.x 
開發者ID:kivymd,項目名稱:KivyMD,代碼行數:18,代碼來源:slidingpanel.py

示例2: add_widget

# 需要導入模塊: from kivy.uix import relativelayout [as 別名]
# 或者: from kivy.uix.relativelayout import RelativeLayout [as 別名]
def add_widget(self, widget, index=0):
        slide = RelativeLayout(size=self.size, x=self.x - self.width, y=self.y)
        slide.add_widget(widget)
        super(Carousel, self).add_widget(slide, index)
        if index != 0:
            self.slides.insert(index, widget)
        else:
            self.slides.append(widget) 
開發者ID:BillBillBillBill,項目名稱:Tickeys-linux,代碼行數:10,代碼來源:carousel.py

示例3: remove_widget

# 需要導入模塊: from kivy.uix import relativelayout [as 別名]
# 或者: from kivy.uix.relativelayout import RelativeLayout [as 別名]
def remove_widget(self, widget, *args, **kwargs):
        # XXX be careful, the widget.parent refer to the RelativeLayout
        # added in add_widget(). But it will break if RelativeLayout
        # implementation change.
        # if we passed the real widget
        if widget in self.slides:
            slide = widget.parent
            self.slides.remove(widget)
            return slide.remove_widget(widget, *args, **kwargs)
        return super(Carousel, self).remove_widget(widget, *args, **kwargs) 
開發者ID:BillBillBillBill,項目名稱:Tickeys-linux,代碼行數:12,代碼來源:carousel.py


注:本文中的kivy.uix.relativelayout.RelativeLayout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。