线条
<p>类CLine表示线条,继承于CView,支持CView的所有属性和方法。</p>
<h2>属性和相关方法:</h2>
<h4>设置线条风格</h4>
<ul>
<li>通过XML属性控制如下:</li>
</ul>
<pre><code class="language-xml">DashStyle="Solid"</code></pre>
<ul>
<li>通过C++程序代码调用方法控制如下:</li>
</ul>
<pre><code class="language-c">void SetDashStyle(DashStyle dashStyle);</code></pre>
<h4>设置线条颜色</h4>
<ul>
<li>通过XML属性控制如下:</li>
</ul>
<pre><code class="language-xml">Color="ID_COLOR_RED"</code></pre>
<ul>
<li>通过C++程序代码调用方法控制如下:</li>
</ul>
<pre><code class="language-c">void SetColor(const String& strColor);</code></pre>
<h4>设置颜色渐变线条开始颜色</h4>
<ul>
<li>通过XML属性控制如下:</li>
</ul>
<pre><code class="language-xml">StartColor="ID_COLOR_BLACK"</code></pre>
<ul>
<li>通过C++程序代码调用方法控制如下:</li>
</ul>
<pre><code class="language-c">void SetStartColor(const String& strColor);</code></pre>
<h4>设置颜色渐变线条结束颜色</h4>
<ul>
<li>通过XML属性控制如下:</li>
</ul>
<pre><code class="language-xml">EndColor="ID_COLOR_WHITE"</code></pre>
<ul>
<li>通过C++程序代码调用方法控制如下:</li>
</ul>
<pre><code class="language-c">void SetEndColor(const String& strColor);</code></pre>
<h2>示例</h2>
<h4>效果图</h4>
<p><img src="http://www.skinui.cn/doc/img/5.0/3/line.png" alt="线条" /></p>
<h4>布局文件</h4>
<pre><code class="language-xml"><RelativeLayout AlignParentLeft="20" AlignParentTop="20" AlignParentRight="20" AlignParentBottom="20">
<TextView Width="100" Height="20" AlignParentLeft="20" AlignParentTop="10" HorzAlign="Right" Text="Solid:" />
<Line Height="1" AlignParentLeft="120" AlignParentRight="20" AlignParentTop="20" Color="ID_COLOR_DEFAULT8" DashStyle="Solid"/>
<TextView Width="100" Height="20" AlignParentLeft="20" AlignParentTop="30" HorzAlign="Right" Text="Dash:" />
<Line Height="1" AlignParentLeft="120" AlignParentRight="20" AlignParentTop="40" Color="ID_COLOR_DEFAULT8" DashStyle="Dash"/>
<TextView Width="100" Height="20" AlignParentLeft="20" AlignParentTop="50" HorzAlign="Right" Text="Dot:" />
<Line Height="1" AlignParentLeft="120" AlignParentRight="20" AlignParentTop="60" Color="ID_COLOR_DEFAULT8" DashStyle="Dot"/>
<TextView Width="100" Height="20" AlignParentLeft="20" AlignParentTop="70" HorzAlign="Right" Text="DashDot:" />
<Line Height="1" AlignParentLeft="120" AlignParentRight="20" AlignParentTop="80" Color="ID_COLOR_DEFAULT8" DashStyle="DashDot"/>
<TextView Width="100" Height="20" AlignParentLeft="20" AlignParentTop="90" HorzAlign="Right" Text="DashDotDot:" />
<Line Height="1" AlignParentLeft="120" AlignParentRight="20" AlignParentTop="100" Color="ID_COLOR_DEFAULT8" DashStyle="DashDotDot"/>
</RelativeLayout></code></pre>