在UI上画横竖线

来源:互联网 发布:网络渠道管理 编辑:程序博客网 时间:2024/05/09 01:44

1.画竖线 <ImageView
            android:layout_width="1dip"
            android:layout_height="match_parent" 
   android:background="@drawable/line_img" 
   />
   
 2. 画横线 <ImageView
            android:layout_width="match_parent"
            android:layout_height="1dip"
   android:background="@drawable/line_img" 
   />
   
3.在限制特定范围的竖线

        <LinearLayout 
             android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_marginTop="5dip"
            android:layout_marginBottom="5dip"
             android:visibility="gone"
            >
        <ImageView         
            android:id="@+id/draw_line_img"
            android:layout_width="1dip"
            android:layout_height="match_parent"
            android:layout_marginTop="5dip"
            android:layout_marginBottom="5dip"
            android:background="@drawable/line_img" 
            android:visibility="gone"
            />
        </LinearLayout>

 

drawable/line_img 是一个点的.9图片。

原创粉丝点击