kivy 滚动imagebutton
2021-04-22 23:13
120 查看
class ImageButton(ButtonBehavior, FloatLayout, Image): def on_press(self): # 这里面可以定义一些处理函数 弹出显示大图还是动态的eee print('pressed',self)
class ScrollView_layout_image(): def myself_scrollview(self,image_list): layout = GridLayout(cols=1, spacing=10, size_hint_y=None) # Make sure the height is such that there is something to scroll. layout.bind(minimum_height=layout.setter('height')) for one_image in image_list: layout1 = GridLayout(cols=1, spacing=10, size_hint_y=None) layout1.add_widget(ImageButton(texture=one_image)) layout.add_widget(layout1) root = ScrollView(do_scroll_x=False,do_scroll_y=True,size_hint=(1, None), size=(Window.width, Window.height)) root.add_widget(layout) return rootif __name__ == '__main__': image_list=[] for i in range(100): image_list.append(Image(source='./face_boder.png').texture) runTouchApp(ScrollView_layout_image().myself_scrollview(image_list))
相关文章推荐
- Android——滚动视图(ScrollView)图片视图(ImageView)、状态开关按钮(ToggleButton)、时钟
- Android——图片视图(ImageView)、状态开关按钮(ToggleButton)、时钟、图片透明度、滚动和时间选择器
- AlphaMobileControls 控件的使用 AlphaImageButton
- 会闪光的按钮Button和图片ImageView,ProgressBar进度条颜色闪动
- 实现Button文字(titleLabel)和图片(imageView)上下排列
- Button / LinkButton / ImageButton
- 关于界面中listview和imagebutton重合问题
- android imagebutton的使用
- Android中Gallery和ImageSwitcher同步自动(滚动)播放图片库
- android--widget介绍之ImageButton
- Android自定义导航图文按钮ImageTextButton
- Android零基础入门第23节:ImageButton和ZoomButton使用大全
- android Button ImageButton 区别
- Silverlight Expression Blend之ImageButton
- 图像按钮ImageButton和图像ImageView
- 《安卓应用开发学习》——关于ImageButton图片背景的设置问题
- WPF ImageButton升级版
- iOS 为导航栏自定义按钮图案Button Image 运行出来的颜色与原本颜色不一样 -解决方案
- java.lang.ClassCastException:android.widget.Button cannot be cast to android.widget.ImageView
- android控件之ImageButton android:scaleType