[英]Flex Mobile 4.6 Unicode Android
我正在使用Flash Builder 4.6构建适用于android的应用程序。 我正在尝试显示xml中的Unicode字符“ http://www.bbc.co.uk/hindi/index.xml”
在Flash Builder提供的模拟器上运行时,字符可以正确显示,但在android上安装时,它将显示方框[] [] [] [] [] [] [] [] [] []。 如何解决此问题,以便正确嵌入字体?
我测试过的android版本是2.3.5。 我的代码如下
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
creationComplete="newCreationComplete(event)" fontSize="11" fontWeight="bold"
xmlns:s="library://ns.adobe.com/flex/spark" title="News">
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
.messageStyle{
height:20;
fontSize:11;
fontWeight:normal;
}
</fx:Style>
<fx:Script>
<![CDATA[
import com.adobe.serialization.json.JSON;
import mx.collections.ArrayCollection;
import mx.core.FlexGlobals;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import spark.events.IndexChangeEvent;
[Bindable] private var newsCollection:Array;
protected function httpServiceNews_resultHandler(event:ResultEvent):void
{
if(!newsCollection)
newsCollection = new Array();
var atom:Namespace = new Namespace("http://www.w3.org/2005/Atom");
var media:Namespace = new Namespace("http://search.yahoo.com/mrss/");
var entryList:XMLList = (event.result as XML)..atom::entry;
for each(var xml:XML in entryList){
var object:Object = new Object();
object.imageUrl = xml.atom::link..media::thumbnail.(@width == "106").@url;
object.summary = xml.atom::summary;
object.title = xml.atom::title;
newsCollection.push(object);
}
}
protected function httpServiceNews_faultHandler(event:FaultEvent):void
{
// TODO Auto-generated method stub
}
protected function newCreationComplete(event:FlexEvent):void
{
httpServiceNews.send();
}
]]>
</fx:Script>
<fx:Declarations>
<s:HTTPService id="httpServiceNews" result="httpServiceNews_resultHandler(event)"
fault="httpServiceNews_faultHandler(event)" resultFormat="e4x"
url="http://www.bbc.co.uk/hindi/index.xml" />
</fx:Declarations>
<s:List dataProvider="{new ArrayCollection(newsCollection)}" width="100%" height="100%"
click="newsListSelectedIndexChanged(event)" >
<s:itemRenderer>
<fx:Component>
<s:IconItemRenderer
iconFunction="newsIconFunction"
messageField="summary"
labelFunction="myLabelFunction"
messageStyleName="messageStyle">
<fx:Script>
<![CDATA[
protected function myLabelFunction(item:Object):String{
return item.title;
}
protected function newsIconFunction(item:Object):String{
return item.imageUrl;
}
]]>
</fx:Script>
</s:IconItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:List>
</s:View>
`
在我看来,默认的android字体不支持此字符集
您将要在这些字体中嵌入带有这些字符的字体。 这个过程非常简单,请查看以下链接:
http://help.adobe.com/zh_CN/flex/mobileapps/WS19f279b149e7481c6a9f451212b87fe7e87-8000.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.