1.C#主è¦å¼åä»ä¹ç±»åç软件
2.gui移植什么意思
3.android onTouchEventåsetOnTouchListenerä¸onTouchçåºå«
C#主è¦å¼åä»ä¹ç±»åç软件
å¯ä»¥å¼å以ä¸ç±»åçç¨åºï¼1ãWindowsæ¡é¢åºç¨ç¨åºï¼ç¨.Netæä¾çWPF模åå¾ä¾¿æ·çå°±è½çææ¡é¢åºç¨ã
2ãWindows Storeåºç¨ç¨åºï¼è¿æ¯Win8以ä¸ç³»ç»é对触æ¸å±åºç设计ï¼éå¸¸å ¨å±è¿è¡çã
3ãWebåºç¨ç¨åºï¼éè¿webFormså建çASP.NETåºç¨ç¨åºã
4ãWCFæå¡ï¼æ¯è¾é«çº§ï¼æ¯ä¸ç§çµæ´»å建åç§åå¸å¼åºç¨ç¨åºçæ¹å¼ï¼å¯éè¿å±åç½æäºèç½äº¤äºå ä¹åç§æ°æ®ã
æ©å±èµæ
ç¨åºæ§è¡
C#æå¼åçç¨åºæºä»£ç 并ä¸æ¯ç¼è¯æè½å¤ç´æ¥å¨æä½ç³»ç»ä¸æ§è¡çäºè¿å¶æ¬å°ä»£ç ãä¸Java类似ï¼å®è¢«ç¼è¯æ为ä¸é´ä»£ç ï¼ç¶åéè¿.NETFrameworkçèææºââ被称ä¹ä¸ºéç¨è¯è¨è¿è¡åºï¼CLRï¼ââæ§è¡ã
ææç.Netç¼ç¨è¯è¨é½è¢«ç¼è¯æè¿ç§è¢«ç§°ä¸ºMSILï¼Microsoft Intermediate Language ï¼çä¸é´ä»£ç ãå æ¤è½ç¶æç»çç¨åºå¨è¡¨é¢ä¸ä»ç¶ä¸ä¼ ç»æä¹ä¸çå¯æ§è¡æ件é½å ·æâ.exeâçåç¼åãä½æ¯å®é ä¸ï¼å¦æ计ç®æºä¸æ²¡æå®è£ .Net Frameworkï¼é£ä¹è¿äºç¨åºå°ä¸è½å¤è¢«æ§è¡ã
å¨ç¨åºæ§è¡æ¶ï¼.Net Frameworkå°ä¸é´ä»£ç ç¿»è¯æ为äºè¿å¶æºå¨ç ï¼ä»è使å®å¾å°æ£ç¡®çè¿è¡ãæç»çäºè¿å¶ä»£ç 被åå¨å¨ä¸ä¸ªç¼å²åºä¸ãæ以ä¸æ¦ç¨åºä½¿ç¨äºç¸åç代ç ï¼é£ä¹å°ä¼è°ç¨ç¼å²åºä¸ççæ¬ãè¿æ ·å¦æä¸ä¸ª.Netç¨åºç¬¬äºæ¬¡è¢«è¿è¡ï¼é£ä¹è¿ç§ç¿»è¯ä¸éè¦è¿è¡ç¬¬äºæ¬¡ï¼é度ææ¾å å¿«ã
åèèµææ¥æºï¼ç¾åº¦ç¾ç§-c#
gui移植什么意思
gui移植什么意思?
移植GUI有三部分内容。触摸第一,屏源将显示屏的码触摸屏驱动与GUI关联起来,第二,源码强势启动公式源码通过实际的触摸显示屏参数来配置GUI,例如显示屏的屏源ambari2.4源码尺寸,是码触摸屏否支持触摸等,第三,源码移植触摸屏驱动。触摸做第一步时只需将最基本的屏源打点,读点,码触摸屏填充等底层函数移植好就行。源码GUI就是触摸山东银软源码个应用程序而已,跑在操作系统上。屏源操作系统是码触摸屏有层次性的源码,有其各自机制,特色机构分时源码裸驱是寄存器,物理地址的操作。移植是qt读excel源码不同平台硬件不同,需要修改。扫写就是写入flash中
android onTouchEventåsetOnTouchListenerä¸onTouchçåºå«
触æ¸äºä»¶ååæºå¶ï¼å¥½å¥½ççï¼
/blog/
Androidä¸çäºä»¶å为æé®äºä»¶å触æ¸äºä»¶ï¼è¿é对触æ¸äºä»¶è¿è¡éè¿°ãTouchäºä»¶æ¯ç±ä¸ä¸ªACTION_DOWNï¼n个
ACTION_MOVEï¼ä¸ä¸ªACTION_UPç»æonClickï¼onLongClickï¼onScrollçäºä»¶ãAndroidä¸çæ§ä»¶é½æ¯ç»§æ¿
Viewè¿ä¸ªåºç±»çï¼èæ§ä»¶å为两ç§ï¼ä¸ç§æ¯ç»§æ¿Viewä¸è½å å«å ¶ä»æ§ä»¶çæ§ä»¶ï¼ä¸ç§æ¯ç»§æ¿ViewGroupå¯ä»¥å å«å ¶ä»æ§ä»¶çæ§ä»¶ï¼æä¸ç§°ä¸ºå®¹å¨æ§
件ï¼æ¯å¦ListViewï¼GridViewï¼LinearLayoutçã
è¿éå 对å 个å½æ°è®²è§£ä¸ã
Ø public boolean dispatchTouchEvent (MotionEventev) è¿ä¸ªæ¹æ³ååTouchEvent
Ø public booleanonInterceptTouchEvent(MotionEvent ev) è¿ä¸ªæ¹æ³æ¦æªTouchEvent
Ø public boolean onTouchEvent(MotionEvent ev) è¿ä¸ªæ¹æ³å¤çTouchEvent
å ¶ä¸viewç±»ä¸ædispatchTouchEventåonTouchEvent两个æ¹æ³ï¼ViewGroup继æ¿Viewï¼èä¸è¿æ°æ·»äºä¸ä¸ª
onInterceptTouchEventæ¹æ³ãActivityä¸ä¹æ onInterceptTouchEventæ¹æ³ï¼ä½æå¦å¤ä¸¤ç§æ¹æ³ãæ们å¯ä»¥
åç°ä¸é¢3个æ¹æ³é½æ¯è¿åbooleanï¼é£å代表ä»ä¹ææå¢ï¼
public boolean dispatchTouchEvent (MotionEvent ev)
Activityä¸è§£éï¼
Called to process touch screen
events.You can override this to intercept all touch screen events before
they aredispatched to the window. Be sure to call this implementation
for touch screenevents that should be handled normally.
Parameters
ev
The touch screen event.
Returns
· boolean Return true if this event was consumed.
å®ä¼è¢«è°ç¨å¤ç触æ¸å±äºä»¶ï¼å¯ä»¥éåè¦çæ¤æ¹æ³æ¥æ¦æªææ触æ¸å±äºä»¶å¨è¿äºäºä»¶ååå°çªå£ä¹åãé常åºè¯¥å¤ç触æ¸å±äºä»¶ï¼ä¸å®è¦è°ç¨è¿ä¸ªå®ç°ãå½è¿
åå¼ä¸ºtrueæ¶ï¼è¡¨ç¤ºè¿ä¸ªäºä»¶å·²ç»è¢«æ¶è´¹äºãä¾å¦å¨TextActivityä¸dispatchTouchEventå¨ACTION_MOVEè¿å
trueï¼è¿è¡ç»æå¦ä¸ï¼
ä¹å°±æ¯å®å¹¶æ²¡ææé£ACTION_MOVEååä¸å»ã
public boolean onInterceptTouchEvent (MotionEvent ev)
Implementthis
method to intercept all touch screen motion events. This allows you
towatch events as they are dispatched to your children, and take
ownership of thecurrent gesture at any point.
Usingthis function takes some care, as it has a fairly complicated interaction with View.onTouchEvent(MotionEvent),and
using it requires implementing that method as well as this one in
thecorrect way. Events will be received in the following order:
1. You will receive the down event here.
2. The
down event will be handled either by a child of this viewgroup, or
given to your own onTouchEvent() method to handle; this means youshould
implement onTouchEvent() to return true, so you will continue to see
therest of the gesture (instead of looking for a parent view to handle
it). Also,by returning true from onTouchEvent(), you will not receive
any followingevents in onInterceptTouchEvent() and all touch processing
must happen inonTouchEvent() like normal.
3. For
as long as you return false from this function, eachfollowing event (up
to and including the final up) will be delivered first hereand then to
the target's onTouchEvent().
4. If
you return true from here, you will not receive any followingevents:
the target view will receive the same event but with the action ACTION_CANCEL, and all further events will be delivered to youronTouchEvent() method and no longer appear here.
Parameters
ev
The motion event being dispatched down the hierarchy.
Returns
· Return
true to steal motionevents from the children and have them dispatched
to this ViewGroup throughonTouchEvent(). The current target will receive
an ACTION_CANCEL event, and nofurther messages will be delivered here.
åºæ¬ææå°±æ¯ï¼
1. ACTION_DOWNé¦å ä¼ä¼ éå°onInterceptTouchEvent()æ¹æ³
2.å¦æ该ViewGroupçonInterceptTouchEvent()å¨æ¥æ¶å°downäºä»¶å¤çå®æä¹åreturn falseï¼é£ä¹åç»çmove, upçäºä»¶å°ç»§ç»ä¼å ä¼ éç»è¯¥ViewGroupï¼ä¹åæådownäºä»¶ä¸æ ·ä¼ éç»æç»çç®æ viewçonTouchEvent()å¤çã
3.å¦æ该ViewGroupçonInterceptTouchEvent()å¨æ¥æ¶å°downäºä»¶å¤çå®æä¹åreturn trueï¼é£ä¹åç»çmove, upçäºä»¶å°ä¸åä¼ éç»onInterceptTouchEvent()ï¼èæ¯ådownäºä»¶ä¸æ ·ä¼ éç»è¯¥ViewGroupçonTouchEvent()å¤çï¼æ³¨æï¼ç®æ viewå°æ¥æ¶ä¸å°ä»»ä½äºä»¶ã
4.å¦ææç»éè¦å¤çäºä»¶çviewçonTouchEvent()è¿åäºfalseï¼é£ä¹è¯¥äºä»¶å°è¢«ä¼ éè³å ¶ä¸ä¸å±æ¬¡çviewçonTouchEvent()å¤çã
5.å¦ææç»éè¦å¤çäºä»¶çviewçonTouchEvent()è¿åäºtrueï¼é£ä¹åç»äºä»¶å°å¯ä»¥ç»§ç»ä¼ éç»è¯¥viewçonTouchEvent()å¤çã
Android touchäºä»¶ä¼ éæºå¶ï¼
æ们å¯ä»¥ççandroidæºä»£ç ï¼
Activity.javaä¸
æä¸ä¸ç®¡onUserInteractionæ¹æ³å 为å®åªæ¯ä¸ä¸ªç©ºæ¹æ³å¦æä½ æ²¡å®ç°çè¯ãgetWindow().superDispatchTouchEvent(ev)ãå ¶ä¸getWindow()è¿åçæ¯PhoneWindowã
PhoneWindow.java:
æ¤å½æ°è°ç¨super.dispatchTouchEvent(event),Activityçrootviewæ¯
PhoneWindow.DecorView,å®ç»§æ¿FrameLayoutãéè¿super.dispatchTouchEventætouchäºä»¶æ´¾
åç»å个Activityçæ¯åviewãåæ¶æå¯ä»¥çå°ï¼å¦æåviewæ¦æªäºäºä»¶ï¼åä¸ä¼æ§è¡onTouchEventå½æ°ã
ViewGroup.javaä¸dispatchTouchEventæ¹æ³ï¼
ç±äºä»£ç è¿é¿è¿éå°±ä¸è´´åºæ¥äºï¼ä½ä¹ç¥éå®è¿åçæ¯
return target.dispatchTouchEvent(ev);
è¿étargetæçæ¯æååçç®æ ï¼å¯ä»¥æ¯å®æ¬èº«ï¼ä¹å¯ä»¥æ¯å®çåViewã
ViewGroup.javaä¸çonInterceptTouchEventæ¹æ³ï¼
é»è®¤æ åµä¸è¿åfalseãå³ä¸æ¦æªtouchäºä»¶ã
View.javaä¸çdispatchTouchEventæ¹æ³
è¿éæ们å¾æ¸ æ¥å¯ä»¥ç¥éå¦æifæ¡ä»¶ä¸æç«ådispatchTouchEventçè¿åå¼æ¯onTouchEventçè¿åå¼
View.javaä¸çonTouchEventæ¹æ³
2024-12-27 15:35
2024-12-27 15:29
2024-12-27 15:20
2024-12-27 15:02
2024-12-27 14:40
2024-12-27 14:39
2024-12-27 13:56
2024-12-27 13:27