Strange display?

Malky

Active Member
Licensed User
Longtime User
Hi I have a few scrollviews to drill down on products, but when I am trying to design the final display details, I get a strange result?

Initially the price displays ok, but after selecting another product and the label price changes, I get a funny figure appear, as if it is blending the two?

I've attached a before and after image if anyone has any ideas?

Malky

B4X:
Sub DisplayDetails(PropId As Int)
Log("Displaying details")
   Dim Cursor1 As Cursor
   Cursor1 = SQL1.ExecQuery("SELECT properties.id, properties." & language & "_desc as lang, properties.image, properties.price, properties.map, properties.web, properties.email, properties.contact FROM properties WHERE properties.id = " & PropId)
      Log("SELECT properties.id, properties." & language & "_desc as lang, properties.image, properties.price, properties.map, properties.web, properties.email, properties.contact FROM properties WHERE properties.id = " & PropId)
   Log("sqlRowCount= " & Cursor1.RowCount)
   Cursor1.Position = 0
   Dim ImageView1 As ImageView
   Dim Bitmap1 As Bitmap
   Bitmap1.InitializeSample(SD_PATH, Cursor1.GetString("image"),310dip,240dip)

   'Dim LabelPrice, lblPrice, LabelContact, LblContact As Label
   Dim btnBack As Button
   btnBack.Initialize("btnBack")
   btnBack.Text = DictionList(11)
   btnBack.Textsize=25
   pnlDetails.AddView(btnBack,0dip,0dip,pnlDetails.Width,50dip)
   ImageView1.Initialize("")
   
   
   pnlDetails.AddView(ImageView1,0dip,51dip,pnlDetails.Width,240dip)
   ImageView1.Bitmap=Bitmap1
   ImageView1.Gravity = Gravity.CENTER
   
   LabelPrice.Initialize("")
   LabelPrice.TextSize=25
   LabelPrice.Color = Colors.Black
   LabelPrice.TextColor = Colors.White
   LabelPrice.Text = DictionList(24)
   pnlDetails.AddView(LabelPrice,2,300dip,100dip,30dip)
   
   lblPrice.Initialize("")
   lblPrice.TextSize=25
   lblPrice.Color=Colors.Transparent
   lblPrice.Text = Cursor1.GetString("price")
   Log("Price = " & lblPrice.Text)
   pnlDetails.AddView(lblPrice,105dip,300dip,200dip,30dip)
   
   
    

   Cursor1.Close


   Log("PropDetails Finished!")
   pnlDetails.Visible = True
End Sub
 

Attachments

  • second.png
    second.png
    97.6 KB · Views: 186
  • first.png
    first.png
    75.9 KB · Views: 198

Malky

Active Member
Licensed User
Longtime User
The I get a java runtime error 'Object should first be initialised (label)'?

Malky
 
Upvote 0

Malky

Active Member
Licensed User
Longtime User
Hey, thanks for that, I've moved the dim and initializations and it appears to be working ok now.

Great advice, have a good one.

Malky
 
Upvote 0
Top