iOS Question Come si traduce la Prorietà Gravity in b4i o in b4x?

ken87

Active Member
Licensed User
Longtime User
B4X:
logoBox.Gravity = Gravity.CENTER

In b4x o b4i come lo traduco Gravity.CENTER?
Grazie mille
 

Star-Dust

Expert
Licensed User
Longtime User
Please write in English in the international forum

B4X
B4X:
logoBox.SetTextAlignment("CENTER","CENTER")

B4I: I don't know what kind of view logoBox is in B4i, I guess it was a textField
B4i:
Dim logoBox As TextField
logoBox.TextAlignment=logoBox.ALIGNMENT_CENTER
 
Upvote 0

ken87

Active Member
Licensed User
Longtime User
The problem that it is not applied to an image here is the original code
B4X:
    Dim logoBox As ImageView
    logoBox.Initialize("")
    logoBox.Bitmap = LoadBitmap(File.DirAssets, "logo.png")
        #if B4a
    logoBox.Gravity = Gravity.CENTER
     #else if B4i
      'logoBox.Gravity = Gravity.CENTER (this goes wrong)
  #End If
    Root.AddView(logoBox, 0, 0, 100%x, 200dip)
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
If it's an image then I don't think it's the right method. I imagined a Label or TextView.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…