oc里使用JQuery 和 bootstrap
来源:互联网 发布:linux# 编辑:程序博客网 时间:2024/06/14 15:30
突然想把Jquery 和 bootstrap这两个框架拖到iOS工程。试了试竟然可以使用:
1 将两个框架复制到工程中
2 写好html代码
3 更改js 和css link的路径
2简单写几个标签测试用
<!DOCTYPE html>
<html>
<head>
<metacharset="utf-8" />
<title></title>
<linkrel="stylesheet"href="/Users/yst911521/Desktop/jqueryandOC/jqueryandOC/bootstrap-3.3.2-dist/css/bootstrap-theme.min.css" />
</head>
<body>
<!-- Split button -->
<div class="btn-group">
<button type="button"class="btn btn-danger">Action</button>
<button type="button"class="btn btn-danger dropdown-toggle"data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<!--JQURE-->
<p id="11">2143242</p>
<div class="22">GTRYHTJUUYY</div>
<div class="div">111</div>
<script type="text/javascript"src="/Users/yst911521/Desktop/jqueryandOC/jqueryandOC/bootstrap-3.3.2-dist/jQueryDownload/jquery-3.1.1.min.js" ></script>
<script type="text/javascript">
//$('.div').hide();
//$('.22').hide();
</script>
</body>
</html>
3web加载
#import "ViewController.h"
@interface ViewController ()
@property(nonatomic,strong)UIWebView*webview;
@end
@implementation ViewController
- (void)viewDidLoad {
[superviewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// /Users/yst911521/Desktop/jqueryandOC/jqueryandOC/bootstrap-3.3.2-dist/jQueryDownload/jquery-3.1.1.min.js
// /Users/yst911521/Desktop/jqueryandOC/jqueryandOC/bootstrap-3.3.2-dist/css/bootstrap-theme.min.css
self.view.backgroundColor=[UIColorredColor];
self.webview =[[UIWebViewalloc]initWithFrame:self.view.bounds];
[self.viewaddSubview:self.webview];
NSURL*url =[[NSBundlemainBundle]URLForResource:@"index"withExtension:@"html"];
NSURLRequest*request =[NSURLRequestrequestWithURL:url];
[self.webviewloadRequest:request];
}
bootstrap 红色button已经出现说明可以使用
注意更改 link路径 为本地路径
<link rel="stylesheet"href="/Users/yst****/Desktop/jqueryandOC/jqueryandOC/bootstrap-3.3.2-dist/css/bootstrap-theme.min.css" />
下面测试 jQuery
//更改本地路径
<script type="text/javascript"src="/Users/yst9*****/Desktop/jqueryandOC/jqueryandOC/bootstrap-3.3.2-dist/jQueryDownload/jquery-3.1.1.min.js" ></script>
web加载
注释掉这两句隐藏两个标签
//$('.div').hide();
//$('.22').hide();
运行结果
//$('.div').hide();
//$('.22').hide();
打开这两句隐藏事件 保存 -> 运行
这样iOS中可以运用这两个框架。更多功能自己去发掘吧。
- oc里使用JQuery 和 bootstrap
- 脚手架搭建的vue项目里引入jquery和bootstrap
- 前端bootstrap和jquery使用记录
- 在angular里面使用jQuery和bootstrap
- 在项目里交叉使用Swift和OC
- 在项目里交叉使用Swift和OC
- 在项目里交叉使用Swift和OC
- 在项目里交叉使用Swift和OC
- 在项目里交叉使用Swift和OC
- 在项目里交叉使用Swift和OC
- 在项目里交叉使用Swift和OC
- 在项目里交叉使用Swift和OC
- 在项目里交叉使用Swift和OC
- jquery和bootstrap
- vue开发:脚手架搭建的vue项目里引入jquery和bootstrap
- bootstrap的datepicker、datetimepicker和jquery的datepicker使用心得
- 使用bootstrap和jQuery制作下拉输入框
- 使用github练习bootstrap,jquery
- HDU4352 lis+状压+数位dp
- Spring(三)Spring整合Struts2、Hibernate
- 打印菱形星号组合
- [c语言]通过指针获取函数内部变量值
- 记录最优解的方案数
- oc里使用JQuery 和 bootstrap
- DOM排序
- 使用visual vm 分析线程(上)
- Java SE学习笔记:网络编程,Socket,B/S
- Codecraft-17 and Codeforces Round #391 (Div. 1 + Div. 2, combined) C - Felicity is Coming!
- 求a和b的最大公约数 gcd(a ,b)= gcd(b, a%b) 例:gcd(36,24) =gcd(24, 12 ) =gcd(12, 0 )
- 【LeetCode】 394. Decode String
- QT内存管理机制
- 算法竞赛入门经典第一章