- 博客(42)
- 收藏
- 关注
原创 1123412
xcrun -sdk iphoneos clang -arch arm64 -rewrite-objc -fobjc-arc -fobjc-runtime=ios-8.0.0 main.mxcrun -sdk iphoneos clang -arch arm64 -rewrite-objc main.m
2024-02-28 11:00:10 328
原创 OC修改导航背景颜色
if (@available(iOS 13.0, *)) { UINavigationBarAppearance *appperance = [[UINavigationBarAppearance alloc]init]; appperance.backgroundImage = [UIImage imageWithColor:MyColor_F7F6F9]; [appperance setShadowImage:[UIImage imageW
2023-12-05 13:49:51 420
原创 iOS 通用链接(Universal Link)唤起app的实现方法
第三步在 xcode里边添加 Caoability -> associated domains 里边添加 applinks:xxxxxxxxxxxxxx.com。第六步 ipone自带浏览器 输入www.xxxxxxxxxxxxxx.com/aaaa 就可以了。第二步: 把上述写好的文件上传到www.xxxxxxxxxxxxxx.com服务器的根目录。那么唤醒你的app的就是 www.xxxxxxxxxxxxxx.com/aaaa。假如接口地址是:www.xxxxxxxxxxxxxx.com。
2023-09-12 15:50:00 623
原创 Flutter默认弹出框
child: Text('暂不更新',style: TextStyle(color: GColors.color153),),Text('请输入正确的图片地址哦。child: Text('去更新'),title: Text('有新版本'),
2023-07-20 13:51:44 198
原创 flutter 延时操作
Future.delayed(Duration(milliseconds: 2000), () {//2秒。Navigator.of(context).pop("pop回去数据");
2023-07-19 17:48:40 209
原创 Flutter常见Bug及处理方法汇总
1.解决嵌套listView添加刷新(SmartRefresher属于import 'package:pull_to_refresh/pull_to_refresh.dart';physics: NeverScrollableScrollPhysics(),到listview即可实现listview和SingleChildScrollView的滑动可同时出发。
2023-06-08 10:28:40 359
原创 关于flutter第三方刷新pull_to_refresh: ^2.0.0 版本的使用
title: Text("我的救援",style: TextStyle(color: Colors.black),),2.使用地方 import 'package:pull_to_refresh/pull_to_refresh.dart';canLoadingText: '松开刷新',refreshingText: '刷新中',completeText: '刷新完成',releaseText: '松开刷新',loadingText:'刷新中',idleText: '下拉刷新',1.导入本地就不废话了。
2023-06-06 13:53:12 389
原创 简单解决网站含中文无法访问的问题
//直接上方法- (NSString *)exchangeString: (NSString *) input{NSString *outputStr = (__bridge NSString *)CFURLCreateStringByAddingPercentEscapes(NULL, /* allocator */(__bridge CFStringRef)input,NULL, /* charactersToLeaveUnescaped */(CFStringRef)@"!
2021-09-28 10:38:03 206
原创 简单实现获取今天昨天某一天的日期
//直接上方法 1是今天 2 是昨天 依次类推-(NSString*)returnDataYYYYMMDD:(int)index{NSTimeInterval secondsPerDay1 = 24*60*60*(index - 1);NSDate *now = [NSDate date];NSDate *yesterDay = [now addTimeInterval:-secondsPerDay1];N...
2021-09-24 15:14:58 103
原创 fluter set get
class Person {late String name;set setName(String name) {this.name = name;}String get getName {return name;}}
2021-08-30 16:33:13 76
原创 Dart定义变量
// 变量类型推到var age = 20;// 常量final heiht = 187;//常量const text = 'const';// const 和 final区别 const在运行前需要赋值 而final不需要
2021-08-27 16:54:30 102
原创 NSTimer解决循环引用
写一个中间类。h@property(weak, nonatomic)id target;+ (instancetype)prowithTarget:(id)taget;.M+ (instancetype)prowithTarget:(id)taget{ Targ * tag = [[Targ alloc] init]; tag.target = taget; return tag;}- (id)forwardingTargetForSelector:...
2021-08-25 14:42:19 86
原创 flutter横向列表
import 'package:flutter/material.dart';void main(List<String> args) {runApp(MyApp());}class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {return MaterialApp(title: 'XXX',home: Scaffold(appBar: new
2021-08-25 11:25:07 424
原创 flutter 纵向列表
body: new ListView(children: <Widget>[//一个一个控件new Image.network('https://t7.baidu.com/it/u=1819248061,230866778&fm=193&f=GIF',),new ListTile(leading: new Icon(Icons.border_right),title: new Text('neirong'),),new ListTile(
2021-08-25 11:03:18 60
原创 flutter Image设置
以网络图为例child: new Image.network('https://IF',scale: 4,//缩放fit: BoxFit.fill, //填充color: Colors.green,//重叠颜色colorBlendMode: BlendMode.darken,//模式repeat: ImageRepeat.repeatY,//纵向填充),
2021-08-24 18:14:32 361
原创 flutter文案
child: new Text('hallo',//内容style: TextStyle(//内容设置fontSize: 30,),),
2021-08-24 17:22:53 66
原创 flutter边距问题
child: Container(padding: const EdgeInsets.fromLTRB(10, 30, 10, 10),//里边内容边距margin: const EdgeInsets.fromLTRB(10, 30, 10, 10),//距离外部边距)
2021-08-24 17:21:27 4696
原创 flutter渐变色
渐变色:decoration: new BoxDecoration(gradient: const LinearGradient(colors: [Colors.lightBlue,Colors.purpleAccent,])),
2021-08-24 17:20:03 166
原创 简单实现修改UITableView的某些线
简单实现修改UITableView的某些线隐藏UITableView下边多余的显示_tableView.tableFooterView = [UIView new];隐藏分割线_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;修改分割线的颜色_tableview.separatorColor =颜色;干货就是这么简单,点个赞再走呀亲!!!...
2021-08-12 00:33:05 62
原创 简单实现范围截图
简单实现范围截图//直接上方法- (UIImage *)pic:(UIView *)view{UIGraphicsBeginImageContextWithOptions(view.bounds.size, YES, 0.0);[view.layer renderInContext:UIGraphicsGetCurrentContext()];UIImage *img = UIGraphicsGetImageFromCurrentImageContext();...
2021-08-09 10:24:38 61
原创 OC简单实现本地图片保存
OC简单实现本地图片保存首先导入头文件#import <Photos/PHPhotoLibrary.h>Ps:不要忘记这个NSPhotoLibraryAddUsageDescription然后下载方法- (void)buttonDownloadTarget{//判断是不是可以下载BOOL isSave =[self isCanDown];__weak typeof(self) weakSelf = self;if (is...
2021-08-05 13:46:02 2005
原创 简单实现修改属性监听
简单实现修改属性监听首先第一步 假设我们要监听A的X属性A *a = [A new];[a addObserver:self forKeyPath:@"X" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil];第二步 实现一个方法-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object chan
2021-07-28 12:24:56 96
原创 简单实现KVO传值
简单实现KVO传值其实KVO的传值核心就是一个传一个接那么代码如下传值:[[NSNotificationCenter defaultCenter]postNotificationName:@“这里是关键字”object:nil userInfo:这里是dic类型的数据];接值:[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(kvoData:) name: @“这里是关键字...
2021-07-27 16:42:59 61
原创 OC简单测试深浅拷贝
OC简单测试深浅拷贝跑一下下边的代码就什么都明白了:先放一下结论NSString:copy是浅拷贝mutableCopy是深拷贝NSMutableString:copy是深拷贝mutableCopy是深拷贝NSArray:copy是浅拷贝mutableCopy是深拷贝NSMutableArray:copy是深拷贝mutableCopy是深拷贝/////以上结论可用下边代码验证NSString* string = @"不可变字符串";N...
2021-07-19 17:29:29 209
原创 本篇和开发无关,查询MFI认证的办法
https://mfi.apple.com/account/accessory-search该网站可以查询MFI认证信息
2021-07-15 11:52:55 1980
原创 OC简单实现修改UISearchBar搜索字数限制
OC简单实现修改UISearchBar搜索字数限制同时这个方法可以实时监控输入框的内容//初始化方法我就不写了,没啥必要//假装我懒加载了一个UISearchBar:self. searchBar//实现它的代理///下边开始正文///一个代理方法解决问题- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{//假设限制10个字符if ...
2021-07-13 16:27:46 83
原创 OC简单实现修改UISearchBar的搜索框
OC简单实现修改UISearchBar的搜索框//假装我懒加载了一个UITextField:self.searchBar///下边开始正文1.通过下边这段代码取出来搜索框UITextField *searchField = [self.searchBar valueForKey:@"searchField"];2.下边对框改一波if (searchField) {searchField.backgroundColor = CDFColor...
2021-07-09 11:07:08 311
原创 OC简单判断本地文件是否存在
简单判断本地文件是否存在NSString * licPath = [NSBundle.mainBundle pathForResource:@"文件名" ofType:"类型"];NSFileHandle *handle = [NSFileHandle fileHandleForReadingAtPath:licPath];NSFileManager * fileManager = [NSFileManager defaultManager];...
2021-07-07 15:09:49 674
原创 OC简单实现计算字符串的长高
简单实现计算字符串的长高//获取字符串的宽度///高固定 字符字号已知-(float) widthForString:(NSString *)string fontSize:(float)fontSize andHeight:(float)height{CGSize sizeToFit = [string sizeWithFont:[UIFont systemFontOfSize:fontSize] constrainedToSize:CGSizeMake(CGFLOAT_MAX, ...
2021-07-07 14:39:15 200
原创 OC简单实现Label赋值前后含空格显示异常问题
简单实现Label赋值前后含空格显示异常问题开始正文///第一个常见解决办法通过获取字段size的方法获取到字段的长高从新更label改布局可以实现结果///第二种方法改变布局思路label下边放一个view将label添加到view上使用masonry布局将labei左右上下调整可以在布局的时候撑开view,从而实现左右假装有空格的目的干货就是这么简单,点个赞再走呀亲!!!...
2021-07-06 15:36:07 339
原创 OC简单实现修改UITextField的输入字数的限制
简单实现修改UITextField的输入字数的限制//初始化方法我就不写了,没啥必要//假装我懒加载了一个UITextField:self.textfieldName///下边开始正文///这段最好写到初始化方法里边[_textfieldNameaddTarget:selfaction:@selector(textFieldEditChanged:)forControlEvents:UIControlEventEditingChanged];- (void)text...
2021-07-05 18:41:10 240
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人