Closed lihuaming07 closed 9 months ago
You're looking at latest
branch of the documentation; but using the 0.4.1 branch. If you look at the stable
version of the docs, they'll point to the 0.4.1 docs, which indicate OptionContainer isn't available on Android.
OptionContainer has been implemented since the release of 0.4.1, and will be included in the upcoming 0.4.2 release (which should be released later today).
Describe the bug
The console tells me that "Toga's Android backend doesn't implement OptionContainer" while I see the official document https://toga.readthedocs.io/en/latest/reference/api/containers/optioncontainer.html#toga.OptionContainer https://toga.readthedocs.io/en/latest/reference/widgets_by_platform.html claims the contrary view.
My codes: def show_ben_gui(self): self.main_box.clear() if not getattr(self, 'correction_book', None): self.correction_book = toga.Box() self.favor_book = toga.Box() self.ben_container = toga.OptionContainer( # line 176 mentioned in the exception content=[ ("主页", toga.Box()), ("错题本", self.correction_book), ("收藏本", self.favor_book) ] ) self.ben_container.on_select = self.ben_selected self.ben_container.current_tab = "错题本" self.main_window.content = self.ben_container
Steps to reproduce
Expected behavior
It would run formally like the official docx..
Screenshots
No response
Environment
Logs
Additional context
No response