C Chmava Member Licensed User Longtime User Oct 6, 2012 #1 Hi, Am i doing something wrong here? It compiler alright but i keep getting error during emulation. Sub FImages1 FIPanel1.Initialize("fipanel1") FIPanel1.Width = 100%x FIPanel1.Height = FIPanel1.Width FIPanel1.SetBackgroundImage(LoadBitmap(File.DirAssets, "ecf.png")) Activity.AddView(FIPanel1, 0, 0, 100%x, 100%y) End Sub Click to expand... any help highly appreciated!!!
Hi, Am i doing something wrong here? It compiler alright but i keep getting error during emulation. Sub FImages1 FIPanel1.Initialize("fipanel1") FIPanel1.Width = 100%x FIPanel1.Height = FIPanel1.Width FIPanel1.SetBackgroundImage(LoadBitmap(File.DirAssets, "ecf.png")) Activity.AddView(FIPanel1, 0, 0, 100%x, 100%y) End Sub Click to expand... any help highly appreciated!!!
klaus Expert Licensed User Longtime User Oct 6, 2012 #2 Try this code: Code: Copy Sub FImages1 FIPanel1.Initialize("fipanel1") Activity.AddView(FIPanel1, 0, 0, 100%x, 100%y) FIPanel1.SetBackgroundImage(LoadBitmap(File.DirAss ets, "ecf.png")) End Sub You shouldn't set FIPanel1.Width and FIPanel1.Height berfore the view is added to the Activity they are defined in the Activity.AddView method. Best regards. Upvote 0
Try this code: Code: Copy Sub FImages1 FIPanel1.Initialize("fipanel1") Activity.AddView(FIPanel1, 0, 0, 100%x, 100%y) FIPanel1.SetBackgroundImage(LoadBitmap(File.DirAss ets, "ecf.png")) End Sub You shouldn't set FIPanel1.Width and FIPanel1.Height berfore the view is added to the Activity they are defined in the Activity.AddView method. Best regards.
C Chmava Member Licensed User Longtime User Oct 6, 2012 #3 klaus said: Try this code: Code: Copy Sub FImages1 FIPanel1.Initialize("fipanel1") Activity.AddView(FIPanel1, 0, 0, 100%x, 100%y) FIPanel1.SetBackgroundImage(LoadBitmap(File.DirAss ets, "ecf.png")) End Sub You shouldn't set FIPanel1.Width and FIPanel1.Height berfore the view is added to the Activity they are defined in the Activity.AddView method. Best regards. Click to expand... OMG! that was the mistake?!?!?!:BangHead: So sorry to trouble you, now i feel really really stupid to make such a stupid mistake, lol. Thank you for your help! Edit: for some weird reason i am receiving a invalid double: "fipanel1"? Last edited: Oct 6, 2012 Upvote 0
klaus said: Try this code: Code: Copy Sub FImages1 FIPanel1.Initialize("fipanel1") Activity.AddView(FIPanel1, 0, 0, 100%x, 100%y) FIPanel1.SetBackgroundImage(LoadBitmap(File.DirAss ets, "ecf.png")) End Sub You shouldn't set FIPanel1.Width and FIPanel1.Height berfore the view is added to the Activity they are defined in the Activity.AddView method. Best regards. Click to expand... OMG! that was the mistake?!?!?!:BangHead: So sorry to trouble you, now i feel really really stupid to make such a stupid mistake, lol. Thank you for your help! Edit: for some weird reason i am receiving a invalid double: "fipanel1"?
klaus Expert Licensed User Longtime User Oct 6, 2012 #4 Did you declare "fipanel1" somewhere else differently ? Otherwise we need to see your code. Best regards. Upvote 0
Did you declare "fipanel1" somewhere else differently ? Otherwise we need to see your code. Best regards.
C Chmava Member Licensed User Longtime User Oct 6, 2012 #5 klaus said: Did you declare "fipanel1" somewhere else differently ? Otherwise we need to see your code. Best regards. Click to expand... Dim FIPanel1 As ScrollView that is all i declared. Edit: this is all the code in ide and i am still getting the error: 'Activity module Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. End Sub Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Dim FIPanel As ScrollView End Sub Sub Activity_Create(FirstTime As Boolean) FIPanel.Initialize("fipanel") End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Click to expand... Last edited: Oct 6, 2012 Upvote 0
klaus said: Did you declare "fipanel1" somewhere else differently ? Otherwise we need to see your code. Best regards. Click to expand... Dim FIPanel1 As ScrollView that is all i declared. Edit: this is all the code in ide and i am still getting the error: 'Activity module Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. End Sub Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Dim FIPanel As ScrollView End Sub Sub Activity_Create(FirstTime As Boolean) FIPanel.Initialize("fipanel") End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Click to expand...
klaus Expert Licensed User Longtime User Oct 6, 2012 #6 Without seeing your other code it's impossible to help you. The most efficient way is to post your project as a zip file so we could have a look at it and test in the same conditions as you do (IDE menu Files / Export As Zip). Otherwise we need to try to guess what it could be and play 'ping pong' for a while. Best regards. Upvote 0
Without seeing your other code it's impossible to help you. The most efficient way is to post your project as a zip file so we could have a look at it and test in the same conditions as you do (IDE menu Files / Export As Zip). Otherwise we need to try to guess what it could be and play 'ping pong' for a while. Best regards.
C Chmava Member Licensed User Longtime User Oct 6, 2012 #7 klaus said: Without seeing your other code it's impossible to help you. The most efficient way is to post your project as a zip file so we could have a look at it and test in the same conditions as you do (IDE menu Files / Export As Zip). Otherwise we need to try to guess what it could be and play 'ping pong' for a while. Best regards. Click to expand... That is probably not it, i create a new one, add in only those code compile successfully, install successfully, when open, it give a double error. i do not believe this happen with the previous version.......... is there any way to re-download the older one? edit: ended up using scrollview2d library instead, work 100% no problem. Scrollview is probably bugged in this version (2.20). Last edited: Oct 6, 2012 Upvote 0
klaus said: Without seeing your other code it's impossible to help you. The most efficient way is to post your project as a zip file so we could have a look at it and test in the same conditions as you do (IDE menu Files / Export As Zip). Otherwise we need to try to guess what it could be and play 'ping pong' for a while. Best regards. Click to expand... That is probably not it, i create a new one, add in only those code compile successfully, install successfully, when open, it give a double error. i do not believe this happen with the previous version.......... is there any way to re-download the older one? edit: ended up using scrollview2d library instead, work 100% no problem. Scrollview is probably bugged in this version (2.20).
klaus Expert Licensed User Longtime User Oct 6, 2012 #8 That is probably not it, i create a new one, add in only those code compile successfully, install successfully, when open, it give a double error. Click to expand... i create a new one Can you post this project as a zip file. it give a double error What errors ? i do not believe this happen with the previous version If you send the project I can try it. I still have the previous versions. Best regards. Upvote 0
That is probably not it, i create a new one, add in only those code compile successfully, install successfully, when open, it give a double error. Click to expand... i create a new one Can you post this project as a zip file. it give a double error What errors ? i do not believe this happen with the previous version If you send the project I can try it. I still have the previous versions. Best regards.
C Chmava Member Licensed User Longtime User Oct 6, 2012 #9 klaus said: i create a new one Can you post this project as a zip file. it give a double error What errors ? i do not believe this happen with the previous version If you send the project I can try it. I still have the previous versions. Best regards. Click to expand... Attached images test. Appreciate your effort! Edit: oh and i am testing it on android 4.0.3 Attachments images test.zip images test.zip 833 bytes · Views: 332 Upvote 0
klaus said: i create a new one Can you post this project as a zip file. it give a double error What errors ? i do not believe this happen with the previous version If you send the project I can try it. I still have the previous versions. Best regards. Click to expand... Attached images test. Appreciate your effort! Edit: oh and i am testing it on android 4.0.3
klaus Expert Licensed User Longtime User Oct 6, 2012 #10 I couldn't test the program in exactly the same conditions as you because you didn't provide the image file in your project and it's the version with ScrollView2D which works for you !?. So how do you expect we could help. You didn't even say what errors you get as I requested in my post. So I modified your program : - added an image file - use two ScrollViews, a vertical ScrollView and a ScrollView2D to test both at the same time. I tested on my devices: - Nexus One Android 2.3.3 - Asus TF 700 tablet Android 4.0.3 The program works perfectly on both devices with B4A 2.2 ! So ScrollView has NO problems with B4A 2.2 as I expected. Best regards. Attachments images test1.zip images test1.zip 34.2 KB · Views: 357 Upvote 0
I couldn't test the program in exactly the same conditions as you because you didn't provide the image file in your project and it's the version with ScrollView2D which works for you !?. So how do you expect we could help. You didn't even say what errors you get as I requested in my post. So I modified your program : - added an image file - use two ScrollViews, a vertical ScrollView and a ScrollView2D to test both at the same time. I tested on my devices: - Nexus One Android 2.3.3 - Asus TF 700 tablet Android 4.0.3 The program works perfectly on both devices with B4A 2.2 ! So ScrollView has NO problems with B4A 2.2 as I expected. Best regards.
C Chmava Member Licensed User Longtime User Oct 6, 2012 #11 klaus said: I couldn't test the program in exactly the same conditions as you because you didn't provide the image file in your project and it's the version with ScrollView2D which works for you !?. So how do you expect we could help. You didn't even say what errors you get as I requested in my post. So I modified your program : - added an image file - use two ScrollViews, a vertical ScrollView and a ScrollView2D to test both at the same time. I tested on my devices: - Nexus One Android 2.3.3 - Asus TF 700 tablet Android 4.0.3 The program works perfectly on both devices with B4A 2.2 ! So ScrollView has NO problems with B4A 2.2 as I expected. Best regards. Click to expand... Sorry. i did not know i cause you so much pain.:sign0013: i cannot provide the image because it's under contract. also, does a 700KB images 1920px * 4000px++ make any different? the problem is saying a number issue with double. which is weird cause all are pure int. so i tested with smaller image and for some miracle, it work, lol.:signOops: Sorry about all this, but atleast we know scrollview probably cant handle big img file, or android cant handle big file with scrollview? Upvote 0
klaus said: I couldn't test the program in exactly the same conditions as you because you didn't provide the image file in your project and it's the version with ScrollView2D which works for you !?. So how do you expect we could help. You didn't even say what errors you get as I requested in my post. So I modified your program : - added an image file - use two ScrollViews, a vertical ScrollView and a ScrollView2D to test both at the same time. I tested on my devices: - Nexus One Android 2.3.3 - Asus TF 700 tablet Android 4.0.3 The program works perfectly on both devices with B4A 2.2 ! So ScrollView has NO problems with B4A 2.2 as I expected. Best regards. Click to expand... Sorry. i did not know i cause you so much pain.:sign0013: i cannot provide the image because it's under contract. also, does a 700KB images 1920px * 4000px++ make any different? the problem is saying a number issue with double. which is weird cause all are pure int. so i tested with smaller image and for some miracle, it work, lol.:signOops: Sorry about all this, but atleast we know scrollview probably cant handle big img file, or android cant handle big file with scrollview?
Informatix Expert Licensed User Longtime User Oct 6, 2012 #12 Chmava said: Sorry about all this, but atleast we know scrollview probably cant handle big img file, or android cant handle big file with scrollview? Click to expand... With such an image size, it's probably an Out of Memory error and is not related to ScrollView. A ScrollView can handle very large sizes (up to the maximum value of an integer). Upvote 0
Chmava said: Sorry about all this, but atleast we know scrollview probably cant handle big img file, or android cant handle big file with scrollview? Click to expand... With such an image size, it's probably an Out of Memory error and is not related to ScrollView. A ScrollView can handle very large sizes (up to the maximum value of an integer).
C Chmava Member Licensed User Longtime User Oct 7, 2012 #13 Informatix said: With such an image size, it's probably an Out of Memory error and is not related to ScrollView. A ScrollView can handle very large sizes (up to the maximum value of an integer). Click to expand... weird thought, it only give out of memory after 2 images in scrollview2d, lol. same resolution and size. is there no way to tell the system to remove from cache? i read only you can request the garbage collector to be run thought. Upvote 0
Informatix said: With such an image size, it's probably an Out of Memory error and is not related to ScrollView. A ScrollView can handle very large sizes (up to the maximum value of an integer). Click to expand... weird thought, it only give out of memory after 2 images in scrollview2d, lol. same resolution and size. is there no way to tell the system to remove from cache? i read only you can request the garbage collector to be run thought.
S StarinschiAndrei Active Member Licensed User Longtime User Nov 12, 2012 #14 Hi , I tried to create a grid with scrollview. In designer i put a scrollview, than i filled with label. It look nice but is not scrollable. Can anybody tell how can i do it ? thx Dim nrrand As Int Dim nrcol As Int Dim colwidth As Int Dim rowhight As Int rowhight=30dip nrcol=5 colwidth = sv.Width /nrcol For y=0 To 120 For i=0 To nrcol -1 l.Initialize("test") l.TextSize =18 l.Text ="rand"&y&"col"&i sv.Panel.AddView(l,colwidth*i,rowhight*y,colwidth,rowhight) Next Next sv.FullScroll(True) Upvote 0
Hi , I tried to create a grid with scrollview. In designer i put a scrollview, than i filled with label. It look nice but is not scrollable. Can anybody tell how can i do it ? thx Dim nrrand As Int Dim nrcol As Int Dim colwidth As Int Dim rowhight As Int rowhight=30dip nrcol=5 colwidth = sv.Width /nrcol For y=0 To 120 For i=0 To nrcol -1 l.Initialize("test") l.TextSize =18 l.Text ="rand"&y&"col"&i sv.Panel.AddView(l,colwidth*i,rowhight*y,colwidth,rowhight) Next Next sv.FullScroll(True)
klaus Expert Licensed User Longtime User Nov 12, 2012 #15 You should add at the end of your routine this line: Code: Copy sv.Panel.Height = rowhight * y to set the height of the internal Panel of the ScrollView according to its content. Best regards. Upvote 0
You should add at the end of your routine this line: Code: Copy sv.Panel.Height = rowhight * y to set the height of the internal Panel of the ScrollView according to its content. Best regards.
S StarinschiAndrei Active Member Licensed User Longtime User Nov 12, 2012 #16 Thank you it works well Upvote 0