設(shè)置全屏: activity中
專注于為中小企業(yè)提供成都網(wǎng)站制作、網(wǎng)站設(shè)計、外貿(mào)網(wǎng)站建設(shè)服務(wù),電腦端+手機端+微信端的三站合一,更高效的管理,為中小企業(yè)西鄉(xiāng)免費做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動了上1000+企業(yè)的穩(wěn)健成長,幫助中小企業(yè)通過網(wǎng)站建設(shè)實現(xiàn)規(guī)模擴充和轉(zhuǎn)變。
requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
加載位圖:
Bitmap map = BitmapFactory.decodeResource(getResources(), R.drawable.chessboard);
實例:
public class GameActivity extends Activity { public class MyView extends View { public MyView(Context context) { super(context); } protected void onDraw(Canvas canvas) { super.onDraw(canvas); Bitmap map = BitmapFactory.decodeResource(getResources(), R.drawable.chessboard); int width = canvas.getWidth(); int height = canvas.getHeight(); Paint paint = new Paint(); paint.setColor(Color.RED); canvas.drawLine(0, 0, width - 1, height - 1, paint); Rect rect1 = new Rect(0, 0, canvas.getWidth(), canvas.getHeight()); Rect rect2 = new Rect(0, 0, map.getWidth() / 2, map.getHeight() / 2); canvas.drawBitmap(map, rect2, rect1, null); invalidate(); } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //設(shè)置全屏 requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); // setContentView(R.layout.activity_game); setContentView(new MyView(this)); }
文章標題:Android設(shè)置全屏,畫圖,加載位圖
本文路徑:http://aaarwkj.com/article8/pdesop.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名、定制網(wǎng)站、關(guān)鍵詞優(yōu)化、移動網(wǎng)站建設(shè)、云服務(wù)器、建站公司
聲明:本網(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)