Jmu5667 Well-Known Member Licensed User Longtime User Apr 2, 2014 #1 hi I have a navigation bar in my app. It has 3 labels which size themselves based on the screen width. Each label has an image assigned to their background(done in the designer) the images are smaller then the label widths. If the user clicks one of the labels I want to change the background image, but when I do the result is a distorted backgound. How can I maintain the aspect ratio as it it when the app load ? Code: Copy Sub lblSettings_Click lblSettings.Gravity = Gravity.CENTER lblSettings.SetBackgroundImage(LoadBitmap(File.DirAssets, "settings_on.png")) End Sub the settings in the designer are; Thanks. John.
hi I have a navigation bar in my app. It has 3 labels which size themselves based on the screen width. Each label has an image assigned to their background(done in the designer) the images are smaller then the label widths. If the user clicks one of the labels I want to change the background image, but when I do the result is a distorted backgound. How can I maintain the aspect ratio as it it when the app load ? Code: Copy Sub lblSettings_Click lblSettings.Gravity = Gravity.CENTER lblSettings.SetBackgroundImage(LoadBitmap(File.DirAssets, "settings_on.png")) End Sub the settings in the designer are; Thanks. John.
Erel B4X founder Staff member Licensed User Longtime User Apr 3, 2014 #2 Consider using a Button instead. This way you will be able to set the different images with the designer. Upvote 0
Consider using a Button instead. This way you will be able to set the different images with the designer.
Jmu5667 Well-Known Member Licensed User Longtime User Apr 3, 2014 #3 Yes that is a possible solution, but I really would like to know why the aspect ratio is not maintained in the label, or if there is a code workaround. Upvote 0
Yes that is a possible solution, but I really would like to know why the aspect ratio is not maintained in the label, or if there is a code workaround.
Erel B4X founder Staff member Licensed User Longtime User Apr 3, 2014 #4 The label gravity doesn't affect the BitmapDrawable gravity. You can create a BitmapDrawable object with the bitmap and correct gravity and then set it as the label background. Upvote 0
The label gravity doesn't affect the BitmapDrawable gravity. You can create a BitmapDrawable object with the bitmap and correct gravity and then set it as the label background.
Jmu5667 Well-Known Member Licensed User Longtime User Apr 3, 2014 #5 Thanks Erel, I try it later, btw, http://stackoverflow.com/questions/10313601/how-to-fast-the-contacts-loading-in-listview-on-android any idea's how we implement this, I'v put a post up on the forum. J. Upvote 0
Thanks Erel, I try it later, btw, http://stackoverflow.com/questions/10313601/how-to-fast-the-contacts-loading-in-listview-on-android any idea's how we implement this, I'v put a post up on the forum. J.
Erel B4X founder Staff member Licensed User Longtime User Apr 4, 2014 #6 ContactsUtils.FindAllContacts should be very fast. Once you start to fetch information for each contact it becomes slower. Upvote 0
ContactsUtils.FindAllContacts should be very fast. Once you start to fetch information for each contact it becomes slower.