5

I have Scrollable Grid Layout in Kivy and I am trying to add Image in that Scrolling view as below.I am not able to see it and I am also trying to make that image change it's size as per dynamically as per screen resolution.

Screen:
			name:"easy_1_1"
			canvas.before:
				Color:	
					rgba:0.2,0.3,0.4,1
				Rectangle:
					size:self.size
			BoxLayout:
				orientation:"vertical"
				padding:20
				spacing:10
				
		
					
				ScrollView:
					GridLayout:
						size_hint: (1, None)
						height: self.minimum_height
						id: layout_content
						cols: 1
						spacing:10
						padding:10
						rows:3
						
						Label:
							text_size:self.size
							text:"[b]What is Programming ?[/b]"
							size_hint_y:None
							valign: 'top'
							font_size:"24sp"
							color:1,1,1,1
							markup:True
							height:"100sp"
							halign:"left"
							halign:'center'	
						
						
						Label:
							text_size:self.size
							text:"test"*100 
							size_hint_y:None
							valign: 'top'
							font_size:"17sp"
							color:1,1,1,1
							markup:True
							height:"660sp"
							halign:"left"
							halign:'center'	
							
              #PRoblem is here can not see the image

						Image:
							source:"aa.png"
							
							
							
					
						
						
				Button:
					text:"Back"
					pos_hint_x:None
					size_hint_y:None
					height:"30dp"
					background_normal: 'blue_with_finger.png'
					background_down: 'bb1.png'
					on_release:sm.current="easy_1"

as mention in code above I can not add image in the scroll able layout...any help will be appreciated.

1 Answer 1

2

Try disabling the size_hint (the y part at least) for your Image:
size_hint_y: None
You'll probably need to define a size , also.

size_hint doesn't seem to work (even the default 1, 1) but, since I haven't worked with a GridLayout, this might be the normal behavior.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.