UILabel *Label = [[UILabel alloc] initWithFrame:CGRectMake(20, 300, 300, 30)]; NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:@"set background color with button"]; [string addAttribute:NSForegroundColorAttr…
为了解决alert在ios版微信中显示url的问题 window.alert = function(name){ var iframe = document.createElement("IFRAME"); iframe.style.display="none"; iframe.setAttribute("src", 'data:text/plain,'); document.documentElement.appendChild(iframe)…
这个需求其实是有的,比如QQ聊天界面里面发送的信息,可以用label来显示文字(也可以用button显示),但是有时候用户可能会发送图片.如果能让Label遇到文字就显示文字,遇到图片就显示图片就好了.可能有的人会说用Quartz2D,直接在Label的drawinrect 里面用上下文画上去.但这感觉太刻意去弄了,而且比较麻烦. 如果你不是在董铂然博客园看到本文,请点击查看原文 推荐一种用Label系统的属性来做. UIImage *image = [UIImage imageNamed:@"…
 UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(8, 100, 300, 30)]; label.textColor = wordGaryColor; //未专门设置的字体颜色 NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"公司简介:发挥收到后即可圣诞节快发吧士大夫深刻的房价高速度开放和山东矿机山东科技…
if (self.messageModel) { NSString * htmlString = self.messageModel.contentText; NSAttributedString * attrStr1 = [[NSAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute…
NSString *contentSrt = [NSString stringWithFormat:@"%@ (%@)",categoryModel.categoryName, categoryModel.phoneCount]; NSRange rang = [contentSrt rangeOfString:categoryModel.categoryName]; NSMutableAttributedString *attStr = [[NSMutableAttributedSt…
没想到这个问题搞了快2个月时间:当然跟我只是断断续续地工作有关. FTGL是freetype的opengl实现.我接触FTGL最初只是为了练习OpenGL,写几个简单的游戏app.开始试了试FTGL觉得挺简单好用,不需要太熟悉OpenGL底层的东西,于是决定在自己的一个app中正式加入用FTGL显示艺术True type字体的功能,预计应该很快能完成吧. 开始进展很顺利,似乎即将大工告成,结果最后突然发现一个问题:艺术字体(中文)显示若干段落以后,突然渲染不正常,总是显示一些混乱的字符:排除了应…
Let’s create a new Xamarin.Forms PCL solution, named Greetings, using the same process described above for creating the Hello solution. This new solution will be structured more like a typical Xamarin.Forms program, which means that it will define a…
#import "AppDelegate.h" @interface AppDelegate () @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIS…
         Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda : 4.5.11    typesetting : Markdown   code """ @Author : 行初心 @Date : 18-10-1 @Blog : www.cnblogs.com/xingchuxin @Gitee : gitee.com/zhichengji…