有谁用过Synth,今天在写XML文件时,编译通不过,代码如下
<style id="scrollBarThumbStyle">
        <state>                        
            <imagePainter method="scrollBarThumbBackground" 
                          direction="horizontal" 
                          path="images/scroll_thumb_horiz_grip.png" 
                          paintCenter="true"
                           />
    </style>
    <bind style="scrollBarThumbStyle" type="region" key="ScrollBarThumb" />
目的是想把图片居中,但是这样写提示Error parsing: org.xml.sax.SAXException: property: you must specify sourceInsets null
如果直接定义sourceInsets的值发现图片不是居中的。

解决方案 »

  1.   

    你的sourceInsets是如何配置的?
    这是我从网上看到的一段示例代码,希望对楼主有用:
    <imagePainter
     path="bg.jpg"
     method="panelBackground"
     sourceInsets="2 2 2 2"
     paintCenter="true" /> 
      

  2.   

    试试添加sourceInsets后,同时添加如下格式的insets ,四个元素分别代表图片在你的窗体或组件中的距顶、左、底、右的距离,楼主可以试一试
    <insets top="4" left="6" bottom="4" right="6"/>
      

  3.   

    因为要添加图片的组件的大小是不定的,如果把sourceInsets写成固定值的话,图片显示的大小就不能固定,目的是想要paintcenter=true起到作用
      

  4.   

    我也在学习中,我遇到TABLE出错的问题了