module.exports = function(Como) {
    var _ = require('/lib/Underscore/underscore.min'),
        $ = require('/lib/Como/Utils'),
        UI = Como.loadUI(),
        config = {},
        create, buildGrid;
        
    create = function(opt) {
        var view = new UI.view({
                backgroundColor: '#FFF',
                backgroundImage: '/images/bg.png'
            }),
            wrapper;
            
        config = $.extend({
            iconSize: 90,
            items: []
        }, opt);
            
        wrapper = buildGrid();
        view.add(wrapper);
            
        Ti.Gesture.addEventListener('orientationchange', function(e) {
            view.remove(wrapper);
            wrapper = buildGrid();
            view.add(wrapper);
        });
        
        return view;
    };
    
    buildGrid = function() {
        var wrapper = new UI.scrolly({
                bottom: '64dp'
            }),
            currentRow = 1,
            currentColumn = 1,
            iconSize = config.iconSize,
            numOfColumn = Math.floor($.pixelToDp(Ti.Platform.displayCaps.platformWidth) / iconSize),
            itemSize = $.pixelToDp(Ti.Platform.displayCaps.platformWidth) / numOfColumn,
            iconMargin = itemSize - iconSize,
            left = iconMargin + (iconMargin / 4),
            top = 0,
            items = config.items;
            
        wrapper.top = left+'dp';
            
        for(var i=0,j=items.length; i<j; i++){
            if (currentColumn > numOfColumn) {
                currentColumn = 1;
                currentRow++;
                left = iconMargin + (iconMargin / 4);
                top += iconSize + (iconMargin / 2);
            }
            var menu = UI.view({
                backgroundImage: items[i].icon,
                height: iconSize+'dp',
                left: left+'dp',
                top: top+'dp',
                width: iconSize+'dp'
            });
            
            menu.on('click', items[i].action);
            
            left += iconSize + (iconMargin / 2);
            currentColumn++;
            wrapper.add(menu);
        }
        
        return wrapper;
    };
    
    return {
        create: create
    };
};
@@ -485,17 +485,47 @@
 tems: %5B%5D
+,%0A            minIconMargin: 8
 %0A
-
         
@@ -1146,24 +1146,25 @@
 idth) / 
+(
 iconSize
 ),%0A     
@@ -1155,16 +1155,40 @@
 iconSize
+ + config.minIconMargin)
 ),%0A     
@@ -1321,36 +1321,43 @@
 ze,%0A            
-left
+segmentSize
  = iconMargin + 
@@ -1354,33 +1354,100 @@
 nMargin 
-+ (iconMargi
+/ 2,%0A            left = segmentSize + (segmentSize / numOfColumn * (numOfColum
 n / 
-4
+2)
 ),%0A     
@@ -1741,36 +1741,68 @@
 t = 
-iconMargin + (iconMargi
+segmentSize + (segmentSize / numOfColumn * (numOfColum
 n / 
-4
+2)
 );%0A 
@@ -1831,38 +1831,28 @@
 iconSize + (
-iconMargin / 2
+left
 );%0A         
@@ -2202,23 +2202,70 @@
  + (
-iconMargi
+segmentSize + (segmentSize / numOfColumn * (numOfColum
 n / 2)
+))
 ;%0A  

fix measurment of gridmenu items margin