图片中红圈的蓝点,是一张图,想用这个做成一个分割线。怎么让这个图在一条线上重复显示啊?
android布局的。

解决方案 »

  1.   

    放ImageActor里直接拉伸吧~
    你还不如直接提供一张大图片省劲呢~
      

  2.   

    在drawable下创建一个xml文件,名字随便取,比如myPic.xmlmyPic.xml  <?xml version ="1.0" encoding ="utf-8"?>
        <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
        android:src="@drawable/你要重复的圆点文件名"
        <!--设置成重复显示-->
        android:tileMode="repeat" />
    给你的装填圆点的view的background设成myPic
      

  3.   

    哦,忘了Android资源文件名不支持大写字母了,你用小写就好了。
    把你装填圆点的View高度设成wrap_content, 宽设成fill_parent,感觉上应该。
      

  4.   

    android:tileMode="repeat" 这句一些上就报错啊
      

  5.   


    <?xml version ="1.0" encoding ="utf-8"?>
    <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
        android:src="@drawable/bg_main"
        android:tileMode="repeat" />
    我这没错啊,你把错发上来看看。
      

  6.   

    可以了 不过分割线是显示整个dialog宽度的  能不能短一点,不要分割到边
      

  7.   

    设View左右的padding
    比如:
    android:paddingLeft="10dp"
    android:paddingRight="10dp"
      

  8.   

    <View
            android:layout_width="fill_parent"
            android:layout_height="2px" 
         android:paddingLeft="10dp"
    android:paddingRight="10dp"         
         android:background="@drawable/mypic"
        
        />
    不行啊  还是到头
      

  9.   


    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
      

  10.   


    这么做是多么浪费性能的做法啊~~~1dot画一次!用9patch吧!
      

  11.   


    你真懂9patch是干什么的么?这个有性能浪费么?胡说也得有根据吧。
      

  12.   

    我也说不好,个人理解:
    你的图片本身宽只有1dot,如果要拉伸到480宽,怎么做?一个循环480遍~就算android内部会有缓存机制,也只是减了IO一步,调用描画接口在back buffer上画还是480遍。
    如果是做成9patch,且拉伸部分尽量长,那就能保证少很多次调用描画接口。当然,你这么小的图片估计是没什么性能问题的。
      

  13.   

    恩,您帮我看看另一个问题吧http://topic.csdn.net/u/20120817/15/b034b29f-4325-4db6-8b55-9e25c6d3be23.html?80065