Android項目中怎么添加分割線?相信很多沒有經(jīng)驗的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。
創(chuàng)新互聯(lián)建站主營伊州網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,成都App制作,伊州h5重慶小程序開發(fā)搭建,伊州網(wǎng)站營銷推廣歡迎伊州等地區(qū)企業(yè)咨詢效果:
Android中如何繪制四邊形
public class ColourLineView extends View{ public ColourLineView(Context context) { super(context, null); } public ColourLineView(Context context, AttributeSet attrs) { super(context, attrs, 0); } public ColourLineView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); int width = getWidth(); int height = getHeight(); Path path = new Path(); canvas.save(); path.reset();//重置路徑 path.moveTo(width/2, 0);//左上點 path.lineTo(0, height);//左下點 path.lineTo(width-width/2, height);//右下點 path.lineTo(width, 0);//右上點 canvas.clipPath(path);//截取路徑所繪制的圖形 canvas.drawColor(Color.RED); path.reset();//重置路徑,準(zhǔn)備繪制第三種顏色的平行四邊形 canvas.restore(); } }
網(wǎng)頁標(biāo)題:Android項目中怎么添加分割線-創(chuàng)新互聯(lián)
本文URL:http://aaarwkj.com/article30/ppjso.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站導(dǎo)航、服務(wù)器托管、App設(shè)計、Google、搜索引擎優(yōu)化、網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容