分类: APP开发

46 篇文章

Android查看签名信息
在keystore文件所在位置,输入 keytool -list -v -keystore test.keystore test.keystore是您的keystore文件
Android查看CPU型号设备信息等
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=…
IOS修改UITabBarController选项图片文本颜色
IOS使用UITabBarController比较多,UITabBarController默认的tabBarItem为灰色和蓝色,是系统默认的,修改如下: UITabBarController *tabBar = [[UITabBarController alloc] init]; tabBar.tabBar.tintColor = [UIColo…
IOS修改状态栏字体颜色为白色
步骤如下: 1、修改info.plist选项View controller-based status bar appearance为NO 2、在app delegate中:[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
Android toobar自定义
Android最新Toobar设计灵活,现简单介绍下最近使用到的问题: 1、添加返回按钮,在Toolbar布局文件添加app:navigationIcon="?attr/homeAsUpIndicator" 2、定义Toobar的title字体样式如下,添加属性app:titleTextAppearance="@style/ToolbarTitle…
IOS计算文本大小
计算文本所占空间大小,已解决UILabel内容自适应的问题。经测试下面代码可用: /** * 计算文本的宽高 * @param str 需要计算的文本 * @param font 文本显示的字体 * @param maxSize 文本显示的范围 * @return 文本占用的真实宽高 */ - (CGSize)sizeWithString:(NSS…
NSArray转成json字符串
NSString *jsonArray = @""; NSMutableArray *array = [[NSMutableArray alloc] init]; for (int i=0; i
关闭多个UIViewController时报异常:Trying to dismiss the presentation controller while transitioning already
关闭多个UIViewController时报异常,google了下,用下面代码可以避免,具体原因可能是关闭一个UIViewController影响到了其他的UIViewController,所以需要关闭了以后再关闭另一个,不能使用循环一下同时关闭多个,不知对不对,还请高手指教。上代码: //这个是我定义的数组,放了多个需要关闭的UIViewCont…
UITableView默认选中第一行
UITableView默认选中第一行,代码如下: NSIndexPath *indexPath=[NSIndexPath indexPathForRow:0 inSection:0]; [_tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewS…
动态计算UITableView每一行的高度
开发中可能会遇到UITableView每一行的高度不一样,可以根据每行不通的内容返回不同高度,修改UITableViewDelegate代理方法如下: - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { UI…
设置UIImageView为圆角
开发中需要设置用户头像显示为圆角,代码如下: headimg.layer.masksToBounds=YES; headimg.layer.cornerRadius=headimg.frame.size.width/2.0f; //设置为图片宽度的一半出来为圆形 headimg.layer.borderWidth=2.0f; //边框宽度 head…