Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
marschne
Posts: 21
Registered: ‎01-13-2011
My Device: 9700 / Playbook

Font of image-list

[ Edited ]

is it possible to change the font-size (height) of an image list?

I can change the background-color, color, font itself (f.e. Times)...but not the font-size!!

 

App is for BB10

webworks (BlackBerry 10 WebWorks SDK 1.0.4.7)

 

my definition of the image-list:

   <div data-bb-type="screen" data-bb-effect="slide-left" data-bb-indicator="true">
      <div style="background-color: #000">
         <label id="caption" style="font-size: 36px; color: GhostWhite; width: 100%">Search result</label>
      </div>
      <div data-bb-type="image-list" id="resultlist" data-bb-context="true"></div>
   	<div data-bb-type="action-bar" data-bb-back-caption="Back"></div>                                                        
      <div data-bb-type="context-menu">
         <div data-bb-type="action" data-bb-img="img/phonecall.png" onclick="showToast('Call contact');">Call contact</div>
         <div data-bb-type="action" data-bb-img="img/mail.png" onclick="showToast('Email contact');">Email contact</div>
         <div data-bb-type="action" data-bb-img="img/addcontact.png" onclick="showToast('Add to contacts');">Add to cantacts</div>
         <div data-bb-type="action" data-bb-img="img/salesinfo.png" onclick="showToast('Sales info');">Sales info</div>
         <div data-bb-type="action" data-bb-img="img/location.png" onclick="showToast('View in Maps');">View in Maps</div>
      </div>
   </div>

 

 

my code for creating the list items:

function loadImageList(element) { 
   var resultList = element.getElementById('resultlist');
   for (var i = 0; i < mc.count; i++) {
      var item = document.createElement('div');
      item.setAttribute('data-bb-type', 'item');
      item.setAttribute('x-blackberry-focusable', 'true');
      item.setAttribute('id', mc.contactarray[i].ID);
      //item.setAttribute('style', 'font-size:20px');
      if(i % 2 == 0) {
         item.setAttribute('style', 'background-color:#f5f5f5');
         //item.setAttribute('style', 'background-color:#f5f5f5;font-size:20px');
      }
      item.onclick = function() { showDetails(); };
      if(mc.contactarray[i].Form == "Person") {
         item.setAttribute('data-bb-title', mc.contactarray[i].Lastname + " " + mc.contactarray[i].Firstname);
         item.setAttribute('data-bb-img', 'img/person.png');    
         item.innerHTML = mc.contactarray[i].Company;
      } else {
         item.setAttribute('data-bb-title', mc.contactarray[i].Company);
         item.setAttribute('data-bb-img', 'img/company.png');    
         item.innerHTML = mc.contactarray[i].Zip + " " + mc.contactarray[i].City;
      }                   
      resultList.appendChild(item);
   }
}

 

Thx.

 

Trusted Contributor
velumani
Posts: 107
Registered: ‎07-26-2012
My Device: Blackberry Z10

Re: Font of image-list

what about this ?

 

listItem.setAttribute('style', 'font-size:32px; font-weight:bold;background-color:#000');



Try my HTML5 app CountDown (free)


Click Accept as Solution if this post that have solved your issue(s)!
Like if you found this post useful..
Contributor
marschne
Posts: 21
Registered: ‎01-13-2011
My Device: 9700 / Playbook

Re: Font of image-list

I tried it...see the commented statements in function loadImageList....no effect.

I also tried it in the html file with css...no effect!

 

Trusted Contributor
velumani
Posts: 107
Registered: ‎07-26-2012
My Device: Blackberry Z10

Re: Font of image-list

Testing with ripple ? if then, did you try after clean browser history ? bcoz.. it works like here



Try my HTML5 app CountDown (free)


Click Accept as Solution if this post that have solved your issue(s)!
Like if you found this post useful..
Contributor
marschne
Posts: 21
Registered: ‎01-13-2011
My Device: 9700 / Playbook

Re: Font of image-list

[ Edited ]

I tested it with:

 

Ripple

VM Simulator

BB10 Alpha

Z10 device

 

I also cleared the browser cache several times!

 

By the way:

when I change the font size on the device (settings), the font height in the app isn't changed!!

Its always the same size.

 

If I change the font size for the title of the screen:

      <div style="background-color: #000">
         <label id="caption" style="font-size: 36px; color: GhostWhite; width: 100%">Search result</label>
      </div>

 ...that works!