如何成为恒生指数如何开户GTN会员

其他回答(2)
XmlSerializer serializer =new XmlSerializer(typeof(PurchaseOrder));
FileStream fs = new FileStream(filename, FileMode.Open);
PurchaseOrder po = new PurchaseOrder();
po = (PurchaseOrder)serializer.Deserialize(fs);
园豆:3740
园豆:3740
园豆:3740
你的这种格式是需要自己解析的吧,因为你的有一些标签是类型,而text值却是属性的值。需要你自己解析。像这样的使用xmlnode解析起来应该不难吧!
园豆:1981
&&&您需要以后才能回答,未注册用户请先。iOS中Info.plist文件的常见配置
但行好事,莫问前程.
嗨,我是曾静 (@devzeng),目前暂居深圳。
这是我用来记录平日学习笔记的地方,欢迎您的访问.
在创建一个新的Xcode工程后,会在Supporting Files文件夹下自动生成一个工程名-Info.plist的文件,这个是对工程做一些运行期配置的文件(很重要,必须有该文件)。如果使用文本编辑器打开这个文件,会发现这是一个XML格式的文本文件,使用Xcode的Open As-&Source Code或者Property List可以进行编辑,本文会重点介绍一些在iOS开发中常见的的Info.plist的配置项。
##Info.plist配置项说明
1、设置启动图标(CFBundleIcons)
&key&CFBundleIcons&/key&
&key&CFBundlePrimaryIcon&/key&
&key&CFBundleIconFiles&/key&
&string&Icon&/string&
&string&Icon@2x&/string&
&string&Icon_120@2x&/string&
2、设置启动闪屏图片(UILaunchImages)
&key&UILaunchImages&/key&
&key&UILaunchImageMinimumOSVersion&/key&
&string&7.0&/string&
&key&UILaunchImageName&/key&
&string&Default&/string&
&key&UILaunchImageOrientation&/key&
&string&Portrait&/string&
&key&UILaunchImageSize&/key&
&string&{320, 568}&/string&
&key&UILaunchImageMinimumOSVersion&/key&
&string&7.0&/string&
&key&UILaunchImageName&/key&
&string&Default&/string&
&key&UILaunchImageOrientation&/key&
&string&Portrait&/string&
&key&UILaunchImageSize&/key&
&string&{320, 480}&/string&
3、设置版本号相关
(1)设置Bundle的版本号(Bundle versions string, short)。
一般包含该束的主、次版本号,这个字符串的格式通常是“n.n.n”(n表示某个数字,如1.1.1)。第一个数字是束的主要版本号,另两个是次要版本号。该关键字的值会被显示在Cocoa应用程序的关于对话框中。该关键字不同于CFBundleVersion,它指定了一个特殊的创建号。而CFBundleShortVersionString的值描述了一种更加正式的并且不随每一次创建而改变的版本号。
&key&CFBundleShortVersionString&/key&
&string&1.0&/string&
(2)设置应用程序版本号(Bundle version)。
每次部署应用程序的一个新版本时,将会增加这个编号,用于标识不同的版本。
&key&CFBundleVersion&/key&
&string&1.0&/string&
4、设置字体相关(Fonts provided by application)
在iOS应用中需要使用系统提供的字体之外的字体,可以将字体文件(.ttf/.odf)复制到项目文件中,另外需要在Info.plist中添加Fonts provided by application的项,对应的源码文件如下:
&key&UIAppFonts&/key&
&string&华文行楷.ttf&/string&
&string&华文新魏.ttf&/string&
&string&黑体_GB2312.ttf&/string&
P.S关于如何使用系统支持的字体信息:
(1)在调用字体的时候,要使用字体名。字体名不是文件名,而是字体的Family Name。Family Name可以在Font Book中查看。
label.font = [UIFont fontWithName:@"字体名称" size:16.0];
(2)遍历出系统支持的全部字体
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
for(int indFamily = 0; indFamily & familyNames. ++indFamily)
NSLog(@"Family Name: %@", [familyNames objectAtIndex:indFamily]);
NSString *fontFamilyName = [familyNames objectAtIndex:indFamily];
NSArray *fontNames = [[NSArray alloc] initWithArray:[UIFont fontNamesForFamilyName:fontFamilyName]];
for(int indFont = 0; indFont & fontNames. ++indFont)
Font Name: %@", [fontNames objectAtIndex:indFont]);
5、设置应用名称(Bundle display name)
&key&CFBundleDisplayName&/key&
&string&应用程序名称&/string&
可以通过在InfoPlist.strings中使用配置让应用在不同的语言环境下显示不同的应用名称,如在English中使用CFBundleDisplayName="Hello World";配置应用程序的名称为Hello World,在Chinese的环境下使用CFBundleDisplayName="你好世界";配置应用程序的名称为你好世界。
6、设置应用标识号(Bundle identifier)
&key&CFBundleIdentifier&/key&
&string&com.devzeng.demo&/string&
7、设置应用支持的屏幕方向(Supported interface orientations)
iOS应用程序支持以下四个方向的设置:UIInterfaceOrientationPortrait(默认竖直方向,HOME键向下)、UIInterfaceOrientationLandscapeLeft(横屏靠左)、UIInterfaceOrientationLandscapeRight(横屏向右)和UIInterfaceOrientationPortraitUpsideDown(竖直方向倒置,HOME键向上)
对应的配置源码如下:
&key&UISupportedInterfaceOrientations&/key&
&string&UIInterfaceOrientationPortrait&/string&
&string&UIInterfaceOrientationLandscapeLeft&/string&
&string&UIInterfaceOrientationLandscapeRight&/string&
&string&UIInterfaceOrientationPortraitUpsideDown&/string&
8、设置应用程序是否支持后台运行(Application does not run in background)
通过UIApplicationExitsOnSuspend可以设置iOS的应用程序进入到挂起状态下是否立即退出,设置为YES表示不支持后台运行退出到后台立即退出,设置为NO表示支持后台运行。
(1)设置支持后台运行
&key&UIApplicationExitsOnSuspend&/key&
(2)设置不支持后台运行
&key&UIApplicationExitsOnSuspend&/key&
##参考资料
最近的文章
如果对Java或者与Java类似的语言熟悉的话,可以说NSOperation对象很像java.lang.Runnable接口。类似的,在Java的Runnable接口中,NSOperation对象被设计为可以扩展的。还是和Java一样,这里也有一个方法可以被重载次数的最小值。对于NSOpetation来说,这个方法就是-(void)main方法.使用NSOperation的最简单的一种方法是把它加入一个NSOperationQueue。一旦operation被加入了这个队列,队列就马上把它...&
更早的文章
Apple自去年发布iOS7以来一直以来都有关注目前各个大厂发布的app,到目前为止基本上绝大多数App Store上的app已经做到iOS7适配,不光是支持iOS7的布局调整更多的是在iOS7整体设计方面的改进,朝着扁平化和简单线条话的方式进行设计。##UI适配在iOS7中view默认是全屏模式,状态栏的高度也加在了view的高度上,例如iOS7之前iPhone5/5s/5c中self.view.frame.size.height = 548,在iOS7中就是568了,在iOS7中nav...&问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
我想用cocos2d-x读取一个plist文件,如下所示:
&key&x&/key&
&integer&0&/integer&
&key&y&/key&
&integer&0&/integer&
&key&x&/key&
&integer&140&/integer&
&key&y&/key&
&integer&12&/integer&
&key&x&/key&
&integer&120&/integer&
&key&y&/key&
&integer&280&/integer&
&key&x&/key&
&integer&40&/integer&
&key&y&/key&
&integer&364&/integer&
它是由(x, y)形式的坐标组成的基础数组序列,我使用的初始代码如下:
NSString *path = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"w%i", world] ofType:@"plist"];
NSMutableArray* points = [NSMutableArray arrayWithContentsOfFile:path];
但是现在,我需要将上述代码翻译成用C++编写的cocos2d-x中,虽然用google搜索了一些文章,但是它们却无法解决我的问题,有没有人可以提供给我一个可利用的数组?
现在,我更改了plist文件的格式:
&key&11x&/key&
&integer&0&/integer&
&key&11y&/key&
&integer&0&/integer&
&key&12x&/key&
&integer&140&/integer&
&key&12y&/key&
&integer&12&/integer&
但仍然出现一样的错误:
CCDictionary&std::string, CCObject*&* dict = CCFileUtils::dictionaryWithContentsOfFile(plistPath);
int x = (int)dict-&objectForKey("11x");
int y = (int)dict-&objectForKey("11y");
我该如何解决?
来源: Stack Overflow 相关的热门问题
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
答:NIKHIL
你可以尝试如下代码:
//const char *pszPath = CCFileUtils::fullPathFromRelativePath(plistName);
//consider that file is in resource bundle..
// CCDictionary&std::string, CCObject*& *plistDictionary=CCFileUtils::dictionaryWithContentsOfFile("testplist.plist");
// CCArray *testitems = (CCArray*)plistDictionary-&objectForKey("root");
或者你也可以这样操作:
CCDictionary&std::string, CCObject*& *plistDictionary = CCFileUtils::dictionaryWithContentsOfFile("testplist.plist");
CCMutableArray&CCObject*& *testitems = (CCMutableArray&CCObject*&*)plistDictionary-&objectForKey("root");
CCLog("COUNT: %d", testitems-&count());
答:Inder Kumar Rathore
我不太清楚如何如何读取数组,所以,你可以先按如下方法更改plist文件:
&dict& &key&root&/key&
&key&x&/key&
&integer&0&/integer&
&key&y&/key&
&integer&0&/integer&
&key&x&/key&
&integer&140&/integer&
&key&y&/key&
&integer&12&/integer&
&key&x&/key&
&integer&120&/integer&
&key&y&/key&
&integer&280&/integer&
&key&x&/key&
&integer&40&/integer&
&key&y&/key&
&integer&364&/integer&
CCDictionary&std::string, CCObject*& *dict = CCFileUtils::dictionaryWithContentsOfFile("yourFile.plist");
CCArray *testitems = (CCArray*)dict-&objectForKey("root");
答:m.ding
当你读取dictionary对象中的项目并使用ObjectForKey("BLA")命令时,你可以按照下述方法将它转换为CCString*:
CCString* tmpStr = (CCString*)(yourDict-&ObjectForKey("KEY"));
int x = tmpStr-&toInt();
同步到新浪微博
分享到微博?
Hi,欢迎来到 SegmentFault 技术社区!⊙▽⊙ 在这里,你可以提出编程相关的疑惑,关注感兴趣的问题,对认可的回答投赞同票;大家会帮你解决编程的问题,和你探讨技术更新,为你的回答投上赞同票。
明天提醒我
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:
扫扫下载 AppPLIST文件在COCOS2D-X中应用的格式详解
发表于 日 00:36 | Hits: 1539
1. 什么是文件格式?
这是一种人类可读的串行化对象文件,由苹果公司发明,最早用于NeXTSTEP系统。详情看这里: 。
从 cocos2d-iphone 发展而来,因此在引擎中大量使用了这种文件格式。
2. 如何编辑文件?
在Mac OS X 系统上,XCode 就可以直接打开和编辑plist文件。而在Windows上,我还没有找到可用的plist编辑软件。
当然,plist是基于XML的纯文本格式,随便找个文本编辑器就可以编辑了。
3.在哪些地方使用了plist格式?
大致有这样几种:
图像纹理定义文件
将多个纹理拼在一张大图上,使用 CCSpriteFrameCache 可以载入这类plist文件;
这里有一个图像纹理定义文件的范例: [cocos2d-x]samplesCppTestCppResourcesanimationsgrossini_family.plist 。
Label纹理定义文件
作用与图像纹理定义文件类似,只不过处理的是自己,面向CCLabelAtlas;
这里有一个Label纹理定义文件的范例: [cocos2d-x]samplesCppTestCppResourcesfontstuffy_bold_italic-charmap.plist 。
帧动画定义
定义一个或多个动画中,使用哪些纹理,使用CCAnimationCache 可以载入这类plist文件;
这里有一个帧动画定义文件的范例: [cocos2d-x]samplesCppTestCppResourcesanimationsanimations.plist 。4. 生成plist文件的工具
对于纹理定义文件来说,它的作用是如何在大图中找到碎图的坐标。因此很多拼合碎图的软件可以在拼合碎图的同时生成plist文件。
是所有平台上最好用的工具了;
是MAC Only的软件,我不太喜欢用;
是Windows Only的软件,功能尚可。
5. 图像纹理定义文件格式说明
cocos2d-x中的纹理定义格式,是以Zwoptex生成的格式为标准的。
Zwoptex生成的格式,有4种主要不同的版本:
format值为0,代表Flash版本;
format值为1,Zwoptex 0.4b以前支持;
format值为2,Zwoptex 1.0以后支持,与format1的区别在于支持旋转;
format值为3,属性名称进行了大幅修改,Zwoptes1.0.2之后支持。这3种格式的plist文件,cocos2d-x都能支持,具体的解析代码在CCSpriteFrameCache::addSpriteFramesWithDictionary。生成的for cocos2d plist格式与Zwoptex生成的format为2的格式相同
5.1 format为0的plist文件
这里贴一个比较完整plist文件,为了方便描述,其中仅包含一个frame。
&?xml version=”1.0″ encoding=”UTF-8″?&
&!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “/DTDs/PropertyList-1.0.dtd”&
&plist version=”1.0″&
&key&texture&/key&
&key&width&/key&
&integer&256&/integer&
&key&height&/key&
&integer&128&/integer&
&key&frames&/key&
&key&grossini.png&/key&
&key&x&/key&
&integer&103&/integer&
&key&y&/key&
&integer&1&/integer&
&key&width&/key&
&integer&51&/integer&
&key&height&/key&
&integer&109&/integer&
&key&offsetX&/key&
&real&0&/real&
&key&offsetY&/key&
&real&-1&/real&
&key&originalWidth&/key&
&integer&85&/integer&
&key&originalHeight&/key&
&integer&121&/integer&
5.2 format为2的plist文件内容
&?xml version=”1.0″ encoding=”UTF-8″?&
&!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “/DTDs/PropertyList-1.0.dtd”&
&plist version=”1.0″&
&key&frames&/key&
&key&parts-dragon_leg_l.png&/key&
&key&frame&/key&
&string&{{866,2},{152,254}}&/string&
&key&offset&/key&
&string&{0,0}&/string&
&key&rotated&/key&
&key&sourceColorRect&/key&
&string&{{0,0},{152,254}}&/string&
&key&sourceSize&/key&
&string&{152,254}&/string&
&key&metadata&/key&
&key&format&/key&
&integer&2&/integer&
&key&realTextureFileName&/key&
&string&dragon.png&/string&
&key&size&/key&
&string&{}&/string&
&key&smartupdate&/key&
&string&$:SmartUpdate:26d1d28da42d44fea750:1/1$&/string&
&key&textureFileName&/key&
&string&dragon.png&/string&
5.3 format为3的plist文件内容
&?xml version=”1.0″ encoding=”UTF-8″?&
&!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “/DTDs/PropertyList-1.0.dtd”&
&plist version=”1.0″&
&key&frames&/key&
&key&armyLevelBg.png&/key&
&key&aliases&/key&
&key&spriteColorRect&/key&
&string&{{0, 0}, {61, 36}}&/string&
&key&spriteOffset&/key&
&string&{0, -0}&/string&
&key&spriteSize&/key&
&string&{61, 36}&/string&
&key&spriteSourceSize&/key&
&string&{61, 36}&/string&
&key&spriteTrimmed&/key&
&key&textureRect&/key&
&string&{{195, 2}, {36, 61}}&/string&
&key&textureRotated&/key&
&key&metadata&/key&
&key&version&/key&
&string&1.6.0&/string&
&key&format&/key&
&integer&3&/integer&
&key&size&/key&
&string&{256, 512}&/string&
&key&name&/key&
&string&army_zw.zwd&/string&
&key&textureFileName&/key&
&string&army_zw_cocos2d.png&/string&
&key&premultipliedAlpha&/key&
Top-Left originating rectangle of the sprite’s pixel texture coordinates. Cocos2′d will convert these to UV coordinates (0-1) when loading based on the texture size.
Zwoptex trim’s transparency off sprites. Because of this sprite’s need to be offset to ensure their texture is drawn in correct alignment to their original size.
Source Color Rect:
This is the Top-Left originating rectangle that is the valid pixel data of the sprite. Say you have a 512×512 sprite that only has 10×10 pixels of data inside of it located at 500×500. The source color rect could be {500,500,10,10}.
Version number related to what version of Zwoptex was used so cocos2d knows how to parse the plist properly.
Flash Version: 0
Desktop Version 0-0.4b: 1
Desktop Version 1.x: 2
In general if you’re not trimming images you can set offset to be 0,0 and sourceColorRect to 0,0,frame.size.width,frame.size.height.
http://www.cocos2d-iphone.org/forums/topic/zwoptex-and-their-plist-explanation/
5. Label纹理定义文件
对这种格式的具体的解析代码在CCLabelAtlas::initWithString 。
6. 帧动画定义文件格式说明
后面的篇幅会进行详细的介绍
您可能也喜欢:
评价列表(0)

我要回帖

更多关于 恒生指数如何买卖 的文章

 

随机推荐