iOS Question Mass change of labels using map file

Discussion in 'iOS Questions' started by John Woodsmall, Jun 1, 2016.

  1. John Woodsmall

    John Woodsmall Active Member Licensed User

    I have this map file "en.map":
    Code:
    Button1="Clearit"
    Button12=OK - Birthday
    Button14=Testimonials
    Button2=Cancel
    Button3=Clear
    Button4=Sound - ON
    DatePicker1=Date
    General_info=General Info
    Lable1=Person x >>
    Lable3=                  An Entertainment Feature Of:  © Lifestyle Interactive Media - All Rights Reserved
    Lable4=Person 
    2 >>
    lblfirstdate=Tap 
    to Enter 1st Person
    lblseconddate=Tap 
    to Enter 2nd Person
    Read_Person1=Retrieve Person 
    1
    Results=Results
    Save_Person1=Save Person 
    1 as Default
    Scores=Scores
    Speek1=TAP This GOLD Text 
    To Enter 1st Person By VOICE
    Speek2=TAP This GOLD Text 
    To Enter 2nd Person By VOICE
    main.lable1=Hold Blue 
    Button Above  to speak birth data (Sample: ... May 51987
    main.textview2=Check accuracy of BIRTHDATA:
    main.lable2= After Correct Birth Date loads CLICK HERE 
    TO GO BACK (to home)
    I run this sub:
    Code:
    Sub Table7_CellClick (Col As Int, Row As Int)
        
    Log("CellClick: " & Col & " , " & Row)
        rx = Row
        language_name = Table7.GetValue(
    0,Row)
        language_abv = Table7.GetValue(
    1,Row)
        
    'Msgbox ("Language=" & language_name & " " & language_abv," ")
        MapFileName = language_abv & ".map"
        
    Log ("Mapfile name=" & MapFileName)
       
    Dim m As Map = File.ReadMap(File.DirAssets, MapFileName)
       
    For Each v As View In Page1.RootPanel.GetAllViewsRecursive
          
    Log("--" & v & v.Tag)
         
    If v Is Label And v.Tag <> Null And m.ContainsKey(v.Tag) Then
           
    Dim lbl As Label = v
           lbl.Text = m.Get(v.Tag)
          
    Log("Lable text=" & lbl.Text)
         
    End If
        
    If v Is Button And v.Tag <> Null And m.ContainsKey(v.Tag) Then
           
    Dim bt As Button = v
           bt.Text = m.Get(v.Tag)
          
    Log("Button text=" & bt.Text)
          
    End If
        
    'If v Is ImageView And v.Tag <> Null And m.ContainsKey(v.Tag) Then
         '  Dim ve As ImageView = v
         '  ve.Text = m.Get(v.Tag)
        '  Log(ve.Text)
         'End If
       Next
    End Sub
    I am expecting to modify the labels and buttons in the app, but I get this trace in the log:
    Code:
    --<B4IViewWrapper: <UIImageView: 0x166eca50; frame = (0 0320 1022.5); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x166ec990>>>
    --<B4IViewWrapper: <UIImageView: 
    0x165bb8f0; frame = (0 0348.81 65.9911); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x165bb890>>>
    --<B4IViewWrapper: <UIButton: 
    0x166ee110; frame = (185.718 309.215103.7 65.9911); clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x165bd910>; layer = <CALayer: 0x165bbe40>>>
    --<B4IViewWrapper: <UIButton: 
    0x165bdcb0; frame = (18.8546 310.158113.128 28.2819); clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x165bee60>; layer = <CALayer: 0x165bda10>>>
    --<B4IViewWrapper: <UIButton: 
    0x165bf220; frame = (9.4273 388.405122.555 29.2246); clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x165c0330>; layer = <CALayer: 0x165bef60>>>
    --<B4IViewWrapper: <UIButton: 
    0x165c06b0; frame = (148.951 388.405160.264 29.2246); clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x165c1600>; layer = <CALayer: 0x165c03f0>>>
    --<B4IViewWrapper: <UIDatePicker: 
    0x165c1760; frame = (9.42729 377.092282.819 160.264); clipsToBounds = YES; hidden = YES; layer = <CALayer: 0x165c3de0>>>
    --<B4IViewWrapper: <UILabel: 
    0x16625590; frame = (72.5902 171.577179.119 28.2819); text = ' Tap to Enter 1st Person'; clipsToBounds = YES; gestureRecognizers = <NSArray: 0x16624760>; layer = <_UILabelLayer: 0x16625fb0>>>
    --<B4IViewWrapper: <UIButton: 0x166242c0; frame = (0 381.806103.7 37.7092); clipsToBounds = YES; hidden = YES; opaque = NO; gestureRecognizers = <NSArray: 0x166235b0>; layer = <CALayer: 0x16624bb0>>>
    --<B4IViewWrapper: <UILabel: 
    0x16623380; frame = (72.5902 244.167179.119 28.2819); text = ' Tap to Enter 2nd Person'; clipsToBounds = YES; gestureRecognizers = <NSArray: 0x166227f0>; layer = <_UILabelLayer: 0x16623490>>>
    --<B4IViewWrapper: <UIButton: 0x16622350; frame = (207.401 379.9284.8457 37.7092); clipsToBounds = YES; hidden = YES; opaque = NO; gestureRecognizers = <NSArray: 0x16621680>; layer = <CALayer: 0x16622c50>>>
    --<B4IViewWrapper: <UILabel: 
    0x16621450; frame = (6.59911 171.577103.7 28.2819); text = 'Person 1 >>'; clipsToBounds = YES; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x16621560>>>
    --<B4IViewWrapper: <UILabel: 0x16620990; frame = (6.59911 244.167103.7 28.2819); text = 'Person 2 >>'; clipsToBounds = YES; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x1663a6c0>>>
    --<B4IViewWrapper: <UIButton: 0x1661fdd0; frame = (150.837 278.105160.264 28.2819); clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x1661f120>; layer = <CALayer: 0x16620170>>>
    --<B4IViewWrapper: <UIButton: 
    0x1661ec60; frame = (7.54184 277.163131.982 28.2819); clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x1661dfb0>; layer = <CALayer: 0x1661f000>>>
    --<B4IViewWrapper: <UIButton: 
    0x1661daf0; frame = (263.964 172.5247.1365 28.2819); clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x1661bcc0>; layer = <CALayer: 0x1661de90>>>
    --<B4IViewWrapper: <UIButton: 
    0x1661b800; frame = (263.964 243.22447.1365 28.2819); clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x1661ab50>; layer = <CALayer: 0x1661bba0>>>
    --<B4IViewWrapper: <UIImageView: 
    0x1661a950; frame = (0 69.76295.2157 51.8501); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x1661aa30>>>
    --<B4IViewWrapper: <UIImageView: 
    0x165f4a30; frame = (226.255 69.76294.273 51.8501); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x165f49e0>>>
    --<B4IViewWrapper: <UIImageView: 
    0x16619890; frame = (95.2157 69.762131.982 51.8501); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x16619b10>>>
    --<B4IViewWrapper: <UIImageView: 
    0x166186a0; frame = (10.37 460.995296.96 38.6519); clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x165f69c0>; layer = <CALayer: 0x16620c60>>>
    --<B4IViewWrapper: <UIButton: 
    0x165f6d30; frame = (18.8546 340.325113.128 28.2819); clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x165f7bd0>; layer = <CALayer: 0x165f6aa0>>>
    --<B4IViewWrapper: <UILabel: 
    0x165f7d10; frame = (10.37 421.4296.96 37.7092); text = '                   An Ent...'; clipsToBounds = YES; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x165f7cb0>>>
    --<B4IViewWrapper: <UILabel: 0x165f88b0; frame = (329.955 490.21994.273 37.7092); text = ''; clipsToBounds = YES; gestureRecognizers = <NSArray: 0x165f94f0>; layer = <_UILabelLayer: 0x165f8830>>>
    --<B4IViewWrapper: <UILabel: 0x165f95f0; frame = (9.42729 145.18304.916 18.8546); text = 'TAP This GOLD Text To Ent...'; clipsToBounds = YES; gestureRecognizers = <NSArray: 0x165579e0>; layer = <_UILabelLayer: 0x165f9570>>>
    --<B4IViewWrapper: <UILabel: 0x165577f0; frame = (9.42729 213.057304.916 18.8546); text = 'TAP This GOLD Text To Ent...'; clipsToBounds = YES; gestureRecognizers = <NSArray: 0x165561c0>; layer = <_UILabelLayer: 0x16557900>>>
    --<B4IViewWrapper: <UIButton: 0x16555d40; frame = (113.128 122.555113.128 18.8546); opaque = NO; gestureRecognizers = <NSArray: 0x16555090>; layer = <CALayer: 0x165560e0>>>
    there are questions:
    1.) why do it not work?
    2.) why does it see: UIImageView ; when it is not asked for and how to avoid this.

    thanks!
    john
     
  2. John Woodsmall

    John Woodsmall Active Member Licensed User

    Also do i need double quotes around the tags?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    1. Hard to say from this code snippet. You should create a small project and upload it (with the map file).
    2. You are iterating over all views:
    Code:
    For Each v As View In Page1.RootPanel.GetAllViewsRecursive
    Log("--" & v & v.Tag)
    You don't need to add quotes.
     
  4. John Woodsmall

    John Woodsmall Active Member Licensed User

    Sent test_trans.zip to support.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice