sungl

Q: htmlView anchor links in Cover flow issue.

Hi,

 

I am trying to make a cover flow view with these components.

 

- Label for title

- Label for sub title

- ImageView for image container

- htmlView for html contents.

 

Data is fetched via XHR in JSON format and everything works ok except one thing.

The links in htmlView is not doing anything. When the link is touched, it changes color to :hover status, but doesn't go further.

 

I tested on Widget Tester as well as iBooks and none of those are working.

Is it bug or am I missing something?

 

Thank you.

iAd Producer

Posted on Aug 5, 2013 3:45 PM

Close

Q: htmlView anchor links in Cover flow issue.

  • All replies
  • Helpful answers

  • by patixa,

    patixa patixa Aug 7, 2013 11:45 AM in response to sungl
    Level 3 (597 points)
    Aug 7, 2013 11:45 AM in response to sungl

    Would you be a little more specific about the HTML in the view? For example, are you using an iframe? How are the links specified? Anything interesting show up in the web inspector (Preview > Show Web Inspector When Previewing) when you use Widget Tester?

  • by sungl,

    sungl sungl Aug 8, 2013 7:30 AM in response to patixa
    Level 1 (0 points)
    Aug 8, 2013 7:30 AM in response to patixa

    JSON structure looks like this

     

    { "pages" :

         [ {     "header" : "My Header",

              "subheader" : "My Sub Header",

              "image" : "http://example.com/example1.jpg",

              "description" : "<a href=\"http://loremipsum.com\">Lorem ipsum</a> ..." },

         ...

    ]}

     

    In the method cellAtIndexInContainer,

     

    this.cellAtIndexInContainer = function (container, index) {

              var newView = iAd.Archiver.restoreFromArchive(this.archivedPrototypeCell);

              var page = this.pages[index];

              var imagePath = page.image || '';

     

      newView.subviews[3].text = page.header || '';

              newView.subviews[2].text = page.subheader || '';

              newView.subviews[1].image = iAd.Image.imageForURL(imagePath, false);

      newView.subviews[0].html = page.description;

     

              return newView;

    }

     

    Now when I see the inspector element, everything looks ok.

    Description box has right html elements and touch event changes the link color to hover state.

    But it does not open web browser to go to the website.

    If you do "Quick Preview" from iAd Producer, the link opens web browser when touched.