1. 程式人生 > >ionic grid(柵格) 九宮格

ionic grid(柵格) 九宮格

1、Html

<ion-header-bar class="bar bar-header bar-light bar-calm">
    <button class="button button-icon icon ion-navicon"></button>
    <ion-title class="bar-calm">騰訊新聞</ion-title>
</ion-header-bar>

<ion-content>
    <div class="row row-wrap">
        <div class="col col-25" ng-repeat="item in items">
            <img src="img/ionic.png" ng-click="alertClick({{item.text}})">
        </div>
    </div>
    <br>
    <div class="row row-wrap">
        <div class="col col-25" ng-repeat="item in items">
            <p>{{item.text}}</p>
        </div>
    </div>
    <br>
    <div class="row row-wrap">
        <div class="col col-25" ng-repeat="item in items">
            <ul>
                <li>
                    <img src="img/ionic.png" ng-click="alertClick({{item.text}})">
                    <p>{{item.text}}</p>
                </li>
            </ul>
        </div>
    </div>
</ion-content>

2、Controller

appCntrollers.controller('ManageGridCtrl', function ($scope, $timeout, $ionicLoading) {
    $ionicLoading.show({
        content: 'Loading',
        animation: 'fade-in',
        showBackdrop: true,
        maxWidth: 200,
        showDelay: 0
    });

    $timeout(function () {
        $ionicLoading.hide();
        $scope.items = [
            { id: 1, text: "111111" }, { id: 2, text: "222222" }, { id: 3, text: "333333" },
            { id: 4, text: "444444" }, { id: 5, text: "555555" }, { id: 6, text: "666666" },
            { id: 7, text: "777777" }, { id: 8, text: "888888" }, { id: 9, text: "999999" },
            { id: 10, text: "aaaaaa" }, { id: 11, text: "bbbbbb" }, { id: 12, text: "cccccc" },
        ];
    }, 2000);

    $scope.alertClick = function (val) {
        alert(val);
    }
})
3、Css
/* 柵格grid */
.col-25{border: 1px solid #ddd;height: 120px;display:flex;justify-content:center;align-items: center;}
.col-25 img {height: 64px; width: 64px;}
.col-25 ul li img {height: 64px; width: 64px;margin-top: 12px}
.col-25 ul li p {text-align: center;}

4、效果圖



相關推薦

ionic grid(柵格) 九宮

1、Html <ion-header-bar class="bar bar-header bar-light bar-calm"> <button class="button button-icon icon ion-navicon">&l

微信小程式weui線上入門教程-WeUi基礎元件-grid九宮

效果圖 wxml程式碼 <view class="page"> <view class="page__hd"> <view class="page__title">Grid</view>

使用GRID來實現九宮選單

1、標頭檔案中宣告用到的變數 CAknGrid* iGrid;    CAknGridM* iGridM;    TInt iNumOfRows;    TInt iNumOfColumns;    TSize iCellSize;    TInt iGraphHeight;

Android 九宮

控件實現 itemid osi getitemid new extend item vertica listview   如下代碼直接復制到項目就可以運行使用了。我們都知道,android的九宮格可以用GridView控件實現,這裏首先定義一個   gridview.xml

使用GridView和SimpleAdapter實現手機界面常見的九宮

adapt height lns androi code 兩個 sha itme find 首先是兩個XML界面: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:androi

【iOS開發系列】九宮布局

使用 objc with div self. orm i++ back hab /** * 這個盡管非常easy,算是一個小技巧,可是碰到了就記錄下來吧.積跬步,致千裏嘛. */ - (void)scratchableLatex { for (int i=

Ext grid中單元編輯,editor為combobox時用法

.com clas ont con reat back trap hang style { header: ‘TO_PTN_NM‘, dataIndex: "TO_PTN_NM", sortable: true, rend

IOS 自定義按鈕(代碼實現)+九宮

uifont 排列 end uiview height iyu void rec name 在一些下載應用裏整個頁面都是按鈕,有好多好多,但是仔細觀察不難發現他們很有規律。就像下面一樣?? 很有規律的排列在屏幕上,那麽這需要我們怎麽去做能。 正如標題,我們需要了解兩個知

css九宮

css rst child wid nbsp last tex ast first <style type="text/css"> li { width: 100%; float: left; } li:first-child:nth

九宮抽獎

click javascrip fun on() image css logs 應用 typeof 從網上找了個插件,自己整理了下思路,註釋了下,感覺挺好的。分享給大家,百度網盤下載看看吧。鏈接:http://pan.baidu.com/s/1pKO0eRx 密碼:hu35

css實現九宮

http order content image 九宮格 bili back lan osi 原理:浮動+margin負邊距 示例代碼: <!DOCTYPE html> <html lang="zh"> <head>

2016年8月6日 九宮日記

www efi name font atd cross ott uil type html { height: 100% } body { min-height: 100% } a { } img::selection { background-color: rgba(0,

奇數平方的九宮

end oid () text object void con form send private void btnTest_Click(object sender, EventArgs e) { int num = (int)nume

函數入門實例、九宮實例、判斷某日是當年的第幾天實例

bin nag ret vpd ++i 是把 alt 技術分享 mov 實現環境:Python 3: 1.函數入門實例 #/usr/bin/env python # -*- coding:utf-8 -*- # @time :2018/1/26 21:37 # @Au

CSS九宮樣式

idt adding add ali cnblogs padding pad logs title CSS .main>div { width: 14%; min-width: 160px; padding: 2%; height: 6

九宮

list() 必須 amd __main__ utf uil end .py file 一、九宮格1、第一種方式 #!/usr/bin/env python # -*- coding:utf-8 -*- # @Time : 2018/1/28 17:25 # @Aut

九宮、函數入門、判斷某天為某年的第幾天

log months object 應該 number 特殊 alt paper oss 九宮格 #!/usr/bin/env python#!--coding:utf-8 --#!shenjie :2018/1/28 22:58#!@Auther :shenjie#!@f

九宮自適應布局

translate kit set str blog order con lis webkit <!DOCTYPE html> <html> <head> <meta charset="utf-8">

fcode-頁面九宮自動鎖屏jquery插件

china href 連續 art 支持 http 函數 背景圖片 pic fcode.js 自動鎖屏插件 fcode.js是什麽? fcode.js是一款web頁面九宮格自動鎖屏js插件,依賴於jquery, 會在設置的範圍裏,判斷用戶有無操作,然後執行鎖屏的功能。 就

九宮題目

can out parse 入行 main args static java i++ import java.util.*;public class javaaa { private static boolean flase; public static void ma