在keystore文件所在位置,输入
keytool -list -v -keystore test.keystore
test.keystore是您的keystore文件
在keystore文件所在位置,输入
keytool -list -v -keystore test.keystore
test.keystore是您的keystore文件
1、查看设备信息build.prop
cat /system/build.prop | grep "product"
ro.product.model=Redmi Note 4X
ro.product.brand=xiaomi
ro.product.name=mido
ro.product.device=mido
ro.product.board=msm8953
# ro.product.cpu.abi and ro.product.cpu.abi2 are obsolete,
# use ro.product.cpu.abilist instead.
ro.product.cpu.abi=arm64-v8a
ro.product.cpu.abilist=arm64-v8a,armeabi-v7a,armeabi
ro.product.cpu.abilist32=armeabi-v7a,armeabi
ro.product.cpu.abilist64=arm64-v8a
ro.product.locale=zh-CN
# ro.build.product is obsolete; use ro.product.device
ro.build.product=mido
ro.product.first_api_level=23
ro.product.manufacturer=Xiaomi
ro.product.cuptsm=XIAOMI|ESE|02|01
2、查看CPU的架构等信息
cat /proc/cpuinfo
Processor : AArch64 Processor rev 4 (aarch64)
processor : 0
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 1
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 2
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 3
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 4
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 5
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 6
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 7
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
Hardware : Qualcomm Technologies, Inc MSM8953
Find Location是一款位置追踪、位置查找工具,可用于公司车辆定位、外勤人员定位、朋友定位、亲人定位等场景。
支持2种定位方式:
1、设备定位,需要给定位人员安装Find Location定位端,支持位置实时上报,查询实时位置。
2、分享定位,生成定位链接,发送给需要定位的人员,打开链接即可获取位置信息。
手机设备定位使用方法:
1、安装Find Location,注册账户并添加设备生成设备定位码。
2、给需要定位的设备安装Find Location定位端,并输入正确的设备定位码。
3、即可使用Find Location查看实时定位信息及历史轨迹播放。
分享链接定位使用方法:
1、安装Find Location,注册账户并生成分享定位链接地址。
2、将链接地址通过微信或QQ等聊天工具分享给您想要知道其位置的人员。
3、当其打开该链接时,即可获取其位置(可能是大概的或精确的位置)。
下载地址:https://location.geekapp.cn/LocationServer/index.html
帮助文档:https://location.geekapp.cn/LocationServer/help.html
IOS使用UITabBarController比较多,UITabBarController默认的tabBarItem为灰色和蓝色,是系统默认的,修改如下:
UITabBarController *tabBar = [[UITabBarController alloc] init];
tabBar.tabBar.tintColor = [UIColor colorWithRed:(0xc9)/255.0f green:(0x29)/255.0f blue:(0x21)/255.0f alpha:1];
步骤如下:
1、修改info.plist选项View controller-based status bar appearance为NO
2、在app delegate中:[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
Android最新Toobar设计灵活,现简单介绍下最近使用到的问题:
1、添加返回按钮,在Toolbar布局文件添加app:navigationIcon=”?attr/homeAsUpIndicator”
2、定义Toobar的title字体样式如下,添加属性app:titleTextAppearance=”@style/ToolbarTitleAppearance”
计算文本所占空间大小,已解决UILabel内容自适应的问题。经测试下面代码可用:
/**
* 计算文本的宽高
* @param str 需要计算的文本
* @param font 文本显示的字体
* @param maxSize 文本显示的范围
* @return 文本占用的真实宽高
*/
- (CGSize)sizeWithString:(NSString *)str font:(UIFont *)font maxSize:(CGSize)maxSize
{
NSDictionary *dict = @{NSFontAttributeName : font};
// 如果将来计算的文字的范围超出了指定的范围,返回的就是指定的范围
// 如果将来计算的文字的范围小于指定的范围, 返回的就是真实的范围
CGSize size = [str boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:dict context:nil].size;
return size;
}
1、UIViewController继承UITabbarcontroller
2、实现协议UITabBarControllerDelegate
3、设置协议
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.delegate = self;
}
4、实现协议方法
-(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController{
if (/*满足一个条件时,不跳转,返回NO*/) {
return NO;
}
return YES;
}
NSString *jsonArray = @"";
NSMutableArray *array = [[NSMutableArray alloc] init];
for (int i=0; i<10; i++) {
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
dict[@"id"] = [NSNumber numberWithInt:i];
[array addObject:dict];
}
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:array options:NSJSONWritingPrettyPrinted error:nil];
jsonArray = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
jsonArray即为array转成的字符串。
关闭多个UIViewController时报异常,google了下,用下面代码可以避免,具体原因可能是关闭一个UIViewController影响到了其他的UIViewController,所以需要关闭了以后再关闭另一个,不能使用循环一下同时关闭多个,不知对不对,还请高手指教。上代码:
//这个是我定义的数组,放了多个需要关闭的UIViewController
@property(nonatomic, strong)NSMutableArray *viewControllers;
-(void)dismissViewControllerAll{
if (_viewControllers != nil && _viewControllers.count>0) {
UIViewController *controller = [_viewControllers lastObject];
NSLog(@"dismissViewControllerAll controller=%@", controller);
if (controller != nil) {
[controller dismissViewControllerAnimated:NO completion:^{//不用此种方式,会异常:Trying to dismiss the presentation controller while transitioning already
[_viewControllers removeObject:controller];
[self dismissViewControllerAll];
}];
}else{
[_viewControllers removeObject:controller];
[self dismissViewControllerAll];
}
}
}
1、选中某个元素:
[_collectionView selectItemAtIndexPath:indexPath animated:NO scrollPosition:UICollectionViewScrollPositionNone];
cell.selected = YES;
[self collectionViewDidSelectItem:cell];//自定义选中样式,上面的两行代码必须都加上。这个是自定义方法,因为上面的方法不会自动触发代理方法:didSelectItemAtIndexPath
2、取消选中某个元素
[_collectionView deselectItemAtIndexPath:indexPath animated:NO];
cell.selected = NO;
[self collectionViewDidDeselectItem:cell];//自定义非选中样式,上面的两行代码必须都加上。这个是自定义方法,因为上面的方法不会自动触发代理方法:didDeselectItemAtIndexPath
UITableView默认选中第一行,代码如下:
NSIndexPath *indexPath=[NSIndexPath indexPathForRow:0 inSection:0];
[_tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
注意,调用以上方法并不会自动触发代理方法:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath。
开发中可能会遇到UITableView每一行的高度不一样,可以根据每行不通的内容返回不同高度,修改UITableViewDelegate代理方法如下:
– (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [self tableView:tableView cellForRowAtIndexPath:indexPath];
return cell.frame.size.height;
}
开发中需要设置用户头像显示为圆角,代码如下:
headimg.layer.masksToBounds=YES;
headimg.layer.cornerRadius=headimg.frame.size.width/2.0f; //设置为图片宽度的一半出来为圆形
headimg.layer.borderWidth=2.0f; //边框宽度
headimg.layer.borderColor=[[UIColor whiteColor] CGColor];//边框颜色