Lydia's blog

Every day to be a little better


  • Home

  • Archives

  • Search

css-loading

Posted on 2018-08-02 11:03

.loading{
width: 150px;
height: 15px;
margin: 0 auto;
margin-top:100px;
}
.loading span{
display: inline-block;
width: 15px;
height: 100%;
margin-right: 5px;
border-radius: 50%;
background: lightgreen;
-webkit-animation: load 1.04s ease infinite;
}
.loading span:last-child{
margin-right: 0px;
}
@-webkit-keyframes load{
0%{
opacity: 1;
}
100%{
opacity: 0;
}
}
.loading span:nth-child(1){
-webkit-animation-delay:0.13s;
}
.loading span:nth-child(2){
-webkit-animation-delay:0.26s;
}
.loading span:nth-child(3){
-webkit-animation-delay:0.39s;
}
.loading span:nth-child(4){
-webkit-animation-delay:0.52s;
}
.loading span:nth-child(5){
-webkit-animation-delay:0.65s;
}

效果:。。。。。轮着动

ios-页面上添加图片

Posted on 2018-07-30 15:07

UIImage *image = [UIImage imageNamed:@”introduce”];
UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, image.size.height)];
imageView.contentMode = UIViewContentModeScaleAspectFit;
imageView.backgroundColor = [UIColor greenColor];
imageView.image = image;
imageView.center = self.view.center; // 让图片在中间位置显示 这个会导致上面的frame位置失效
[self.view addSubview:imageView];

添加fuction:

UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(refreshRootController)];
    singleTap.numberOfTapsRequired = 1;
    [imageView1 setUserInteractionEnabled:YES];
    [imageView1 addGestureRecognizer:singleTap];

ios-引入第三方framework file not found

Posted on 2018-07-28 12:53

今天在xcode接入领英登录的功能时,发现了无法找到头文件的问题,明明已经将framework导入到项目中了。
这里写图片描述
在网上查询相关资料后对xcode 引用frameword的认识有了更近一步的认识。

引用而来的第三方framework其路径仍然是属于项目外部的,而
Building Setting 中Framework Search Paths
默认是如下配置——只有内部framework能被找到
这里写图片描述

于是接下来的目的便明确了,让项目能够找到外部的framework。

解决办法
将第三方framework复制放入项目中

在xcode 中 右键文件夹使用 add file to xxx 将 Frameworks文件夹导入到项目中。

xcode会自动在Framework Search Paths 中生成你所存放 framework的路径。

这样,framework里的头文件便能够被找到了。

css-圆角三角形

Posted on 2018-07-27 18:37

div{
width: 0;
height: 0;
transform: rotate(45deg);
border-width: 20px;
border-color: #000 transparent transparent #000;
border-style: solid;
border-top-left-radius: 10px;
}

css- input placeholder 居中

Posted on 2018-07-26 10:44

input::input-placeholder {text-align: center; }
input::-ms-input-placeholder{text-align: center;}
input::-webkit-input-placeholder{text-align: center;}

js-获取element 准确高度 不四舍五入

Posted on 2018-07-25 14:59

document.getElementById(‘divMMHeight’).getBoundingClientRect().height

android -判断小程序环境失效

Posted on 2018-07-24 11:22

在wx.ready(function () {
})里面的判断才有效

ruby- csv utf-8 转 gbk有问题

Posted on 2018-07-18 17:27

require ‘csv’
file_path = “/Users/zhangshuo/Downloads/#{Time.now}-user-email.csv”

CSV.open(file_path, ‘w’) do |writer|
writer << [“\xEF\xBB\xBF”]
User.find_each do |u|
writer << [u.email] unless u.fake_email?
end
end

ios-mobile li click not work

Posted on 2018-07-04 15:43

.liClass { cursor : pointer; }

js-i18n js

Posted on 2018-07-04 10:47

官网
简单使用说明

1.gem “i18n-js”, “>= 3.0.0.rc11”
2.rails generate i18n:js:config
会生成config/i18n-js.yml文件

1
2
translations:
- file: "public/javascripts/%{locale}.js"

3.rake i18n:js:export

添加新的文字之后都要跑rake i18n:js:export才会生效

1…101112…28

Lydia

This is lydia's blog

277 posts
1 categories
46 tags
© 2020 Lydia
Powered by Hexo
|
Theme — NexT.Muse v5.1.4