Why does the following code not release it when I touch the center of the button?
If I touch the bottom of the button, I can release it, so I guess there is probably a problem with the coordinate calculation.
from kivy.lang import Builder
from kivy.uix.floatlayout import FloatLayout
from kivymd.app import MDApp
from kivymd.uix.tab import MDTabsBase
kv = '''
MDBottomNavigation:
MDBottomNavigationItem:
MDTabs:
MyTab:
title: 'tab'
ScrollView:
MDRectangleFlatButton:
id: button
text: self.state
font_size: 60
'''
class MyTab(FloatLayout, MDTabsBase):
pass
class MyApp(MDApp):
def build(self):
return Builder.load_string(kv)
MyApp().run()
There was a problem with _do_touch_up
, an internal function of Carousel in Kivy.
It's necessary to write touch.apply_transform_2d(self.to_widget)
and the associated push()
and pop()
in this function.