ãã°ã©ãã£ãã¯ã¹ï¼ï¼ï¼-Viewã¯ã©ã¹ã¸ã®æç»ã ã§ã¯ãã°ã©ãã£ãã¯ã®æç»ã«Viewã¯ã©ã¹ã使ã£ã¦ãã¾ãããããããSurfaceViewã¯ã©ã¹ã使ã£ã¦å®ç¾ããäºãã§ãã¾ãã SurfaceViewã¯ãViewã¯ã©ã¹ãç¶æ¿ããã¯ã©ã¹ã§ãããViewã¯ã©ã¹ãããé«éã«æç»ãã§ããã²ã¼ã ããã°ã©ãã³ã°çã«é©ãã¦ãã¾ãã é常ã®ã¦ã£ã¸ã§ããã¨éããå¥ã¹ã¬ããã§ç´æ¥ï¼§ï¼µï¼©æä½ããããªãäºãã§ãã¾ãã ä»åã¯ãã°ã©ãã£ãã¯ã¹ï¼ï¼ï¼-Viewã¯ã©ã¹ã¸ã®æç»ãã§ç´¹ä»ããããªã¹ãï¼ï½ãªã¹ãï¼ã®ããã°ã©ã ãã SurfaceViewã§å®ç¾ããã«ã¯ã©ã®ããã«ãããããããã«ã¤ãã¦ã¿ã¦ããã¾ãã SurfaceViewã«ããã°ã©ãã£ãã¯ã¹ã®åºæ¬å½¢-éæ¢ããç»åã®æç» ãã°ã©ãã£ãã¯ã¹ï¼ï¼ï¼-Viewã¯ã©ã¹ã¸ã®æç»ãã®ãªã¹ãï¼ã§ã¯ã Viewã使ã£ã¦ãéæ¢ããç»åãæç»ãã¦ãã¾ãããããããSurfaceView
Bataã®æãã¤ãï¼æ°ã¾ããæ´æ°ï¼ ã¾ã ã¾ã ç´ äººãæªçè ã§ãããã·ã¹ãã ãã³ãã¥ãã±ã¼ã·ã§ã³ã人æè²æãªã©æ¥ã èãã¦ãããã¨ãªã©ä¸å®æã«æ¸ãã¦ããäºå®ã§ãã çæ§ãããããé¡ããã¾ãã ããã°ç»åä¸è¦§ãè¦ã è¨äºä¸è¦§ Androidã®ã¤ï½¥ï½¥ï½¥Â » Androidã®ã¤ã¾ãã-SurfaceViewãéãªããªãï¼! 2013-04-01 19:32:00 ãã¼ãï¼Android ãAndroidã®ã¤ã¾ãããã5åç®ãè¿ãã¾ããã ä»åãæ¸ãã¦ããã¾ããããèªåãã¤ã¾ãããçµé¨ãæ´çãããã¨ã主ç®çï¼æ¥è¨ã¨åãï¼ã¨ãã¦ãåãããã«ã¤ã¾ããã¦ãã人ã«å¯¾ãã¦ä½ãã®æ¯æ´ãã§ããªããã¨ããæå³ã§å ±æããããã¼ã¸ã§ãã ã©ããæããç®ã§è¦å®ã£ã¦ãã ããã ä»åã¯ã¡ãã£ã¨ããæãã¤ãããã®ã¤ã¾ããã§ãã Androidã«ã¯çæ§ãåãã®éããFrameLayoutã¨ããwidgetãéããæã«ä½¿ãã¬ã¤ã¢ã¦ãã
ã¿ããã¤ãã³ãï¼ãã©ãã¯ãã¼ã«ã¤ãã³ãã¯ãç´åã®ç¶æ ã«ä¸æ¸ããã¦ããã®ã§ãæ®åã®ããã«è¡¨ç¤ºããã¾ãã ã©ã¡ããSurfaceViewã«ç¨æããã¦ããã³ã¼ã«ããã¯ã¡ã½ããããªã¼ãã¼ã©ã¤ãããã ãã§ãããæ°ãä»ããªããã°ãªããªãã®ã¯ãSurfaceViewããã©ã¼ã«ã¹ãåãåããããã«setFocusable(true)ãå¼ã³åºããã¨ãããã«ãã¼ã¤ãã³ãã®å ´åã¯ãrequestFocus()ãªã©ã§ãã©ã¼ã«ã¹ãä¸ãã¦ãããã¨ã§ãã éæãªèæ¯ã®SurfaceViewãä½ãã«ã¯ æå¾ã«ãéæãªSurfaceViewã®ä½ãæ¹ã説æãã¾ãããµã³ãã«ã«ãTransparentãã¨ããActivityãããã¾ãããããèµ·åããã¨ã以ä¸ã®ãããªç»é¢ã«ãªãã¾ãã
ãã¤ã³ãã¯ä»¥ä¸ã®ï¼ç¹ã§ãã setFormat(PixelFormat.TRANSLUCENT) ã§èæ¯ã«åéæãè¨å®ãã setZOrderOnTop(true) 㧠SurfaceView ãä¸çªä¸ã«è¡¨ç¤ºããã package com.example; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PixelFormat; import android.util.AttributeSet; import android.view.SurfaceHolder; import android.view.SurfaceView; import
ï¼ï¼éçºç®æ¨ ãã®ãã¼ã¸ã®ç®æ¨ã¯ãSurfaceViewã§ç»åã表示ãããã¨ã§ããSurfaceViewã¯ãåºæ¬çã«è¡¨è£ãããç»é¢ï¼ããã«ãããã¡ï¼ã®ããã§ãç»é¢ãããã¯ãã¦ãè£ã«æãã¦ãããã¯ã解é¤ãã¦è¡¨ã«æã£ã¦æ¥ãã¨ããæãã®æåæ¹æ³ã«ãªãã¾ãã ï¼ï¼ç»åãç¨æãã ç»åãç¨æãã¾ããViewã¨åãã§ããpngãgifãjpegãªã©ã使ãã¾ãããããä¸ã«ã¯ããã°ãããããªã¼ç´ æãµã¤ãããããã®ã§ããã®éçºã§ã¯ãããããã¾ãããåãã¦ãããã¨ã«ãã¾ãã æ¦éèæ¯ãèåãã¨ãã¢ã³ã¹ã¿ã¼ãã´ããªã³ãããã¦ã³ãã¼ããã¾ããã ãããã®ç»åãdrawableãã©ã«ãã®ä¸ã«ç½®ãã¾ãã-hdpiã¨ã-ldpiã¨ãã¯è§£å度ã®éãã§ããã©ããï¼ã¤ã«å ¥ãã¦ç½®ãã°ï¼¯ï¼«ã§ããé©å½ã«ãªãµã¤ãºããã¾ãã ãã©ã«ãæ§æ [ UsingSurfaceView ] [ src ] [ gen ] [ Android 1
SurfaceViewãªãAndroidã§é«éæç»ã²ã¼ã ãä½ããï¼Androidã§åãæºå¸¯Javaã¢ããªä½æå ¥éï¼12ï¼ï¼1/3 ãã¼ã¸ï¼ æ¬é£è¼ã§ãSDKã¨Eclipseã使ã£ã¦Androidã®æºå¸¯ç«¯æ«ã§åãJavaã¢ããªãä½æããAndroid Marketã§ã®é å¸ãç®æãã¾ããã Androidã®éçºè ã¯ã¹ã£ã¼ããã好ãï¼ éçºã³ã¼ããEclairãï¼ã¨ã¯ã¬ã¢ï¼ã§å¼ã°ãã¦ããAndroid 2.0ãã2009å¹´10æ27æ¥ã«ãªãªã¼ã¹ããã¾ããï¼åèï¼ã°ã¼ã°ã«ãAndroid 2.0対å¿ã®SDKãªãªã¼ã¹ï¼ã ç´åã®ãã¼ã¸ã§ã³ãAndroid 1.6 Donutï¼ãã¼ããï¼ãã1ã«æå¼±ã§ã®ã¡ã¸ã£ã¼ã¢ãããã¼ãã§ããAndroid 2.0ã§è¿½å ãããç®çæ©è½ã¯ãBluetoothç¨ã®APIã§ãããã¯Android 1.0ã§æè¼ãè¦éãããããããä»ãã®APIã§ãããã¾ããä»å¾ãBlueto
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}