8_Times_Tables
8
//
// ViewController.swift
// Times Tables
//
// Created by ZC on 16/1/9.
// Copyright © 2016年 ZC. All rights reserved.
// import UIKit class ViewController: UIViewController, UITableViewDelegate { @IBOutlet weak var sliderValue: UISlider! @IBOutlet weak var result: UITableView! @IBAction func sliderMoved(sender: AnyObject) { result.reloadData() } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 20 } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "Cells") let timesTable = Int(sliderValue.value * 20) cell.textLabel?.text = String(timesTable * (indexPath.row + 1)) return cell } override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
} override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
8_Times_Tables的更多相关文章
随机推荐
- UIScrollView中添加一个视图,实现让其始终固定在某个位置
ScrollView中添加一个视图,实现让其始终固定在某个位置,如最底部的位置.方法是自定义一个继承UIScrollView,重写它的layoutSubviews方法.代码如下: #import &q ...
- AssetBundle的使用
using UnityEngine; using System.Collections; using UnityEditor; using System.IO; public class Editor ...
- Git 系列(四):在 Git 中进行版本回退
在这篇文章中,你将学到如何查看项目中的历史版本,如何进行版本回退,以及如何创建 Git 分支以便你可以大胆尝试而不会出现问题. 在你的 Git 项目的历史中,你的位置就像是摇滚专辑中的一个片段,由一个 ...
- PHP MySql数据库访问
PHP MySql数据库访问 计应134 凌豪 1.MySql数据库的连接 要操作MySql数据库,首先必须与MySQl数据库建立连接,连接MySQL服务器的语句如下: <?php$link ...
- Oracle EBS-SQL (SYS-24):职责列表
select B.application_name, TL.responsibility_name from fnd_responsibility_tl tl, fnd_responsibility ...
- Oracle EBS-SQL (SYS-20):OPM接口处理.sql
/* 未加工的材料交易(必须解决) UNcosted Transactions (must resolve) 无成本的交易(必须解决) Pending WIP costing transactions ...
- 限定只能处理"A仓"和"B仓"入库
应用 Oracle Inventory 层 Level Function 函数名 Funcgtion Name INV_INVTTMTX_MISC 表单名 Form Name INVTTMTX 说明 ...
- 使用MIDAS访问远程Access数据库
使用MIDAS访问远程Access数据库 Allen Tao(http://blog.csdn.net/allentao/) 2005-5-3 本文源码下载 访问远程数据库常用的办法是 ...
- NOI2013 Day1
NOI2013 Day1 向量内积 题目描述:两个\(d\)维向量\(A\)与\(B\)的内积为其相对应维度的权值的乘积和,现有\(n\)个\(d\)维向量 ,求是否存在两个向量的内积为\(k\)(\ ...
- Paxos算法小结
转自不正直的绅士,因百度空间迁移,无法注明出处,我从其google搜索引擎中的cache进行的copy. 不正直的绅士 是跟我一起工作过的非常有才的一个青年才俊. Paxos的使用非常广泛.sanlo ...