`
diding
  • 浏览: 80373 次
  • 性别: Icon_minigender_1
  • 来自: 四川
社区版块
存档分类
最新评论

FxTextArea插入图片后,图片上方空隙的解决

    博客分类:
  • Flex
阅读更多
由于开发一个运行期间由用户来设置dg表,无意间打开Navicat,看到我执行
EditManager(_textFlow.interactionManager).insertInlineGraphic(imagePath, width, height);

后的数据库中的数据:
<img fontSize="14" baselineShift="0" textRotation="auto" trackingLeft="0" kerning="on" trackingRight="0" textDecoration="none" color="0x0" textAlpha="1" fontFamily="Times New Roman" lineThrough="false" fontWeight="normal" fontStyle="normal" lineHeight="120%" typographicCase="default" height="59" width="87" source="http://192.168.1.102/CompanyWebSite/upload/commonFile/YaYa.jpg" float="none"/>



当时的感觉,晕,我只指定了soure,width和height,怎么Adobe的开发人员指定那么多默认值,联想到

http://bugs.adobe.com/jira/browse/SDK-19576 提交的一个bug,
于是在执行插入图片,侦听后,手动指定lineHeight
问题得到解决,AS代码片断:
public function inserImage(imagePath:String, width:Number, height:Number):void
		{
			EditManager(_textFlow.interactionManager).insertInlineGraphic(imagePath, width, height)
			_textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGED, graphicStatusChangeEvent, false, 0, true);
			_textFlow.flowComposer.updateAllContainers();
		}

		private function graphicStatusChangeEvent(evt:StatusChangeEvent):void
		{
			var image:InlineGraphicElement=evt.element as InlineGraphicElement;
			image.lineHeight="100%"
			_textFlow.flowComposer.updateAllContainers();

		}


图例:


  • 大小: 41.4 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics