ken87 Active Member Licensed User Longtime User Jun 5, 2023 #1 B4X: logoBox.Gravity = Gravity.CENTER In b4x o b4i come lo traduco Gravity.CENTER? Grazie mille
Star-Dust Expert Licensed User Longtime User Jun 5, 2023 #2 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
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
ken87 Active Member Licensed User Longtime User Jun 6, 2023 #4 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
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)
LucaMs Expert Licensed User Longtime User Jun 6, 2023 #5 Use B4XImageView. You need to select (import) the XUI Views library. Upvote 1
Star-Dust Expert Licensed User Longtime User Jun 6, 2023 #6 If it's an image then I don't think it's the right method. I imagined a Label or TextView. Upvote 0