iOSSegmented Control: icons incorrect?

  1. 3 weeks ago

    Jeff T

    Aug 1 Pre-Release Testers Midlands of England, Europe

    I have 4 images in my project
    I have a segmented control on a view, and it has 4 segments
    In the design window (and latterly in the 'open' event), I assign a different icon to each segment

    yet at run time, all 4 segments display the same icon
    Is this a known bug, as I cannot imagine what I could have done incorrectly given how easy it is to assign these..

  2. Jeremie L

    Aug 1 Pre-Release Testers, Xojo Pro, XDC Speakers Europe (France) - getpackr.io

    Could you share the code you use to set the icons in the Open event?

  3. Jeff T

    Aug 1 Pre-Release Testers Midlands of England, Europe
    Edited 3 weeks ago

    There are 4 segments
    What appears on screen on all the segments is the image associated with item(2) at design stage

    In the Open() event , I tried this:

    self.segment1.Item(0).Icon = img_shop
    self.segment1.Item(1).Icon = img_tick

    But it didnt change anything, and it didnt report an error
    The images are part of the project, dragged in from disc like all my other images

  4. 2 weeks ago

    Jeremie L

    Aug 2 Pre-Release Testers, Xojo Pro, XDC Speakers Europe (France) - getpackr.io
    Edited 2 weeks ago

    When I setup SegmentedControl by code I usually create the items from scratch:

    Segment1.RemoveAll //Remove all items
    
    Dim seg As iOSSegmentedControlItem
    
    seg = new iOSSegmentedControlItem
    seg.Icon = img_shop
    Segment1.Add(seg)
    
    seg = New iOSSegmentedControlItem
    seg.Icon = img_tick
    Segment1.Add(seg)
    
    
    Segment1.Item(0).Selected = True

    I do not remember why I create them from scratch, maybe I discovered the same bug as you two/three years ago.

or Sign Up to reply!