
{"id":241,"date":"2016-03-15T19:45:11","date_gmt":"2016-03-15T11:45:11","guid":{"rendered":"http:\/\/www.jiandaima.com\/blog\/?p=241"},"modified":"2016-12-05T14:59:28","modified_gmt":"2016-12-05T06:59:28","slug":"%e5%b9%bf%e5%91%8a%e5%80%92%e8%ae%a1%e6%97%b6%e6%ac%a2%e8%bf%8e%e7%95%8c%e9%9d%a2%e7%9a%84%e5%ae%9e%e7%8e%b0%ef%bc%8c%e5%80%92%e8%ae%a1%e6%97%b6%e6%ac%a2%e8%bf%8e%e7%95%8c%e9%9d%a2","status":"publish","type":"post","link":"http:\/\/www.jiandaima.com\/blog\/archives\/241.html","title":{"rendered":"\u5e7f\u544a\u5012\u8ba1\u65f6\u6b22\u8fce\u754c\u9762\u7684\u5b9e\u73b0\uff0c\u5012\u8ba1\u65f6\u6b22\u8fce\u754c\u9762"},"content":{"rendered":"<p>\u4eca\u5929\u66f4\u65b0\u4e86\u4e00\u4e2aApp\uff0c\u6253\u5f00\u8fd9\u4e2aApp\u540e\u5f39\u51fa\u7684\u9875\u9762\u662f\u4e00\u4e2a\u5e7f\u544a\u5012\u8ba1\u65f6\u7684\u9875\u9762\uff0c\u5012\u8ba1\u65f6\u5b8c\u6bd5\u540e\u8fdb\u5165\u4e3b\u754c\u9762\u3002\u4e8e\u662f\u6211\u95f2\u7740\u6ca1\u4e8b\u513f\u7b80\u6613\u5b9e\u73b0\u4e86\u4e00\u4e0b\u8fd9\u4e2a\u529f\u80fd\uff0c\u5982\u56fe\uff1a<br \/>\n<img decoding=\"async\" title=\"\" src=\"http:\/\/img.blog.csdn.net\/20150711140409831\" alt=\"\u8fd9\u91cc\u5199\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<hr \/>\n<p>\u5b9e\u73b0\u8fd9\u4e2a\u6548\u679c\u4e5f\u5f88\u5bb9\u6613\uff0c\u5728\u76f8\u5e94\u5e03\u5c40\u95ee\u4e0b\u4e2d\u6dfb\u52a0TextView\u63a7\u4ef6\uff0c\u63a7\u4ef6\u7684\u503c\u5c31\u662f\u5012\u8ba1\u65f6\u7684\u6570\u5b57\uff0c\u8fd9\u91cc\u6211\u7ed9\u5012\u8ba1\u65f6\u6dfb\u52a0\u4e86\u4e00\u4e2a\u52a8\u753b\u6548\u679c\uff0c\u9879\u76ee\u7684\u76ee\u5f55\u7ed3\u6784\u5982\u4e0b\uff1a<br \/>\n<img decoding=\"async\" title=\"\" src=\"http:\/\/img.blog.csdn.net\/20150711140741945\" alt=\"\u8fd9\u91cc\u5199\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>AndroidManifest.xml<br \/>\n\u8fd9\u91cc\u6211\u914d\u7f6e\u4e86WelcomeActivity\u754c\u9762\u4f5c\u4e3a\u5e7f\u544a\u754c\u9762\uff0c\u914d\u7f6e\u5b83\u4e3a\u5e94\u7528\u7684\u7b2c\u4e00\u4e2aactivity\uff0c\u5e76\u4e14\u9690\u85cf\u5176\u6807\u9898\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\r\n&lt;manifest xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;\r\n package=&quot;com.example.timewelcome&quot;\r\n android:versionCode=&quot;1&quot;\r\n android:versionName=&quot;1.0&quot; &gt;\r\n\r\n &lt;uses-sdk\r\n android:minSdkVersion=&quot;8&quot;\r\n android:targetSdkVersion=&quot;19&quot; \/&gt;\r\n\r\n &lt;application\r\n android:allowBackup=&quot;true&quot;\r\n android:icon=&quot;@drawable\/ic_launcher&quot;\r\n android:label=&quot;@string\/app_name&quot;\r\n android:theme=&quot;@style\/AppTheme&quot; &gt;\r\n &lt;activity\r\n android:name=&quot;.MainActivity&quot;\r\n android:label=&quot;@string\/app_name&quot; &gt;\r\n &lt;\/activity&gt;\r\n &lt;activity\r\n android:name=&quot;.WelcomeActivity&quot;\r\n android:label=&quot;@string\/title_activity_welcome&quot;\r\n android:theme=&quot;@android:style\/Theme.NoTitleBar&quot; &gt;\r\n &lt;intent-filter&gt;\r\n &lt;action android:name=&quot;android.intent.action.MAIN&quot; \/&gt;\r\n\r\n &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; \/&gt;\r\n &lt;\/intent-filter&gt;\r\n &lt;\/activity&gt;\r\n &lt;\/application&gt;\r\n&lt;\/manifest&gt;\r\n<\/pre>\n<p>WelcomeActivity.java<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage com.example.timewelcome;\r\n\r\nimport android.app.Activity;\r\nimport android.content.Intent;\r\nimport android.os.Bundle;\r\nimport android.os.Handler;\r\nimport android.view.Window;\r\nimport android.view.animation.Animation;\r\nimport android.view.animation.AnimationUtils;\r\nimport android.widget.TextView;\r\n\r\npublic class WelcomeActivity extends Activity {\r\n\r\n \/\/ \u58f0\u660e\u63a7\u4ef6\u5bf9\u8c61\r\n private TextView textView;\r\n private int count = 5;\r\n private Animation animation;\r\n\r\n @Override\r\n protected void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n \/\/ \u53bb\u9664\u6807\u9898\r\n requestWindowFeature(Window.FEATURE_NO_TITLE);\r\n setContentView(R.layout.activity_welcome);\r\n \/\/ \u521d\u59cb\u5316\u63a7\u4ef6\u5bf9\u8c61\r\n textView = (TextView) findViewById(R.id.textView);\r\n animation = AnimationUtils.loadAnimation(this, R.anim.animation_text);\r\n \/\/textView.startAnimation(animation);\r\n handler.sendEmptyMessageDelayed(0, 1000);\r\n\r\n }\r\n\r\n private int getCount() {\r\n count--;\r\n if (count == 0) {\r\n Intent intent = new Intent(this, MainActivity.class);\r\n startActivity(intent);\r\n finish();\r\n }\r\n return count;\r\n }\r\n\r\n private Handler handler = new Handler() {\r\n public void handleMessage(android.os.Message msg) {\r\n if (msg.what == 0) {\r\n textView.setText(getCount()+&quot;&quot;);\r\n handler.sendEmptyMessageDelayed(0, 1000);\r\n animation.reset();\r\n textView.startAnimation(animation);\r\n }\r\n\r\n };\r\n\r\n };\r\n\r\n}<\/pre>\n<p>activity_welcome.xml<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;FrameLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;\r\n xmlns:tools=&quot;http:\/\/schemas.android.com\/tools&quot;\r\n android:layout_width=&quot;match_parent&quot;\r\n android:layout_height=&quot;match_parent&quot;\r\n android:background=&quot;@drawable\/image&quot;\r\n tools:context=&quot;${relativePackage}.${activityClass}&quot; &gt;\r\n\r\n &lt;LinearLayout\r\n android:layout_width=&quot;wrap_content&quot;\r\n android:layout_height=&quot;wrap_content&quot;\r\n android:layout_gravity=&quot;right&quot;\r\n android:orientation=&quot;horizontal&quot; &gt;\r\n\r\n &lt;TextView\r\n android:layout_width=&quot;wrap_content&quot;\r\n android:layout_height=&quot;wrap_content&quot;\r\n android:layout_gravity=&quot;right&quot;\r\n android:text=&quot;\u5e7f\u544a\u5012\u8ba1\u65f6\uff1a&quot;\r\n android:textColor=&quot;#ffffff&quot;\r\n android:textSize=&quot;20sp&quot; \/&gt;\r\n\r\n &lt;TextView\r\n android:id=&quot;@+id\/textView&quot;\r\n android:layout_width=&quot;wrap_content&quot;\r\n android:layout_height=&quot;wrap_content&quot;\r\n android:layout_gravity=&quot;right&quot;\r\n android:text=&quot;5&quot;\r\n android:textColor=&quot;#ffffff&quot;\r\n android:textSize=&quot;20sp&quot; \/&gt;\r\n\r\n &lt;TextView\r\n android:layout_width=&quot;wrap_content&quot;\r\n android:layout_height=&quot;wrap_content&quot;\r\n android:layout_gravity=&quot;right&quot;\r\n android:text=&quot;\u79d2&quot;\r\n android:textColor=&quot;#ffffff&quot;\r\n android:textSize=&quot;20sp&quot; \/&gt;\r\n &lt;\/LinearLayout&gt;\r\n\r\n&lt;\/FrameLayout&gt;<\/pre>\n<p>\u52a8\u753b\u7684xml\u6587\u4ef6animation_text.xml\u5b58\u653e\u5728\u4e86res\/anim\u76ee\u5f55\u4e0b\uff0c\u5b9e\u73b0\u900f\u660e\u5ea6\u548c\u7f29\u653e\u7684\u52a8\u753b\u3002<br \/>\nanimation_text.xml<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\r\n&lt;set xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot; &gt;\r\n\r\n &lt;alpha\r\n android:duration=&quot;1000&quot;\r\n android:fromAlpha=&quot;0.0&quot;\r\n android:toAlpha=&quot;1.0&quot; \/&gt;\r\n\r\n &lt;scale\r\n android:duration=&quot;800&quot;\r\n android:fromXScale=&quot;1.5&quot;\r\n android:fromYScale=&quot;1.5&quot;\r\n android:pivotX=&quot;50%&quot;\r\n android:pivotY=&quot;50%&quot;\r\n android:toXScale=&quot;1.0&quot;\r\n android:toYScale=&quot;1.0&quot; \/&gt;\r\n\r\n&lt;\/set&gt;<\/pre>\n<pre><code>\u00a0<\/code><\/pre>\n<hr \/>\n<p>\u5b9e\u9645\u9879\u76ee\u4e2d\uff0c\u672c\u6848\u4f8b\u53ca\u6211\u4e4b\u524d\u5199\u7684\u4e24\u7bc7\u535a\u5ba2\uff1a ViewPager\u5b9e\u73b0\u5e94\u7528\u7684\u6b22\u8fce\u754c\u9762 \uff0cAnimation Frame\u52a8\u753b\u5b9e\u73b0\u5e94\u7528\u7684\u6b22\u8fce\u754c\u9762 \u90fd\u662f\u6709\u903b\u8f91\u95ee\u9898\u7684\u3002\u90a3\u4e48\u5982\u4f55\u6b63\u786e\u7684\u5b9e\u73b0\u5462\uff1f\u4e0b\u9762\u63d0\u4f9b\u6211\u7684\u4e2a\u4eba\u601d\u8def\uff1a<\/p>\n<p>\u4e00\u822c\u5e94\u7528\u7684\u7b2c\u4e00\u6b21\u5f00\u542f\u90fd\u4f1a\u5148\u51fa\u73b0\u4e00\u4e2a\u6b22\u8fce\u9875\u9762\uff0c\u7136\u540e\u51fa\u73b0\u5bfc\u822a\u9875\u9762\u6216\u8005\u5e7f\u544a\u9875\u9762\u7b49\uff0c\u7136\u540e\u518d\u8fdb\u5165\u4e3b\u9875\u9762\u3002\u6240\u4ee5\u6211\u4eec\u9700\u8981\u5224\u65ad\u8fd9\u4e2a\u5e94\u7528\u662f\u5426\u662f\u7b2c\u4e00\u5b89\u88c5\u5e76\u5f00\u542f\u7684\uff0c\u8fd9\u91cc\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528sharedpreference\u6765\u4fdd\u5b58\u5e94\u7528\u662f\u5426\u5f00\u542f\u8fd9\u4e2a\u6807\u8bc6\u7b26\uff0c\u5982\u679c\u662f\u7b2c\u4e00\u6b21\u5f00\u542f\uff0c\u5c31\u4ece\u6b22\u8fce\u9875\u9762\u8df3\u8f6c\u5230\u5bfc\u822a\u9875\uff0c\u7136\u540e\u5bfc\u822a\u9875\u518d\u8df3\u8f6c\u5230\u4e3b\u9875\u9762\uff0c\u5426\u5219\u76f4\u63a5\u4ece\u6b22\u8fce\u9875\u8df3\u8f6c\u5230\u4e3b\u9875\u9762\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u539f\u6587\u5730\u5740\uff1a<a title=\"http:\/\/bbs.jiandaima.com\/thread-209-1-1.html\" href=\"http:\/\/bbs.jiandaima.com\/thread-209-1-1.html\" target=\"_blank\">http:\/\/bbs.jiandaima.com\/thread-209-1-1.html<\/a><\/p>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u6253\u5f00\u8fd9\u4e2aApp\u540e\u5f39\u51fa\u7684\u9875\u9762\u662f\u4e00\u4e2a\u5e7f\u544a\u5012\u8ba1\u65f6\u7684\u9875\u9762\uff0c\u5012\u8ba1\u65f6\u5b8c\u6bd5\u540e\u8fdb\u5165\u4e3b\u754c\u9762<\/p>\n","protected":false},"author":1,"featured_media":522,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[18,19,21,49],"class_list":{"0":"post-241","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-the-development-of-communication-technology","8":"tag-android","10":"tag-app","11":"tag-49"},"post_thumbnail_image":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/05\/64022-3.png?imageView2\/1\/w\/300\/h\/300#","content_first_image":"http:\/\/img.blog.csdn.net\/20150711140409831","post_medium_image_300":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/05\/64022-3.png?imageView2\/1\/w\/600\/h\/356#","post_thumbnail_image_624":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/05\/64022-3.png","post_frist_image":"http:\/\/img.blog.csdn.net\/20150711140409831","post_medium_image":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/05\/64022-3.png?imageView2\/1\/w\/600\/h\/356#","post_large_image":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/05\/64022-3.png","post_full_image":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/05\/64022-3.png","post_all_images":[{"imagesurl":"http:\/\/img.blog.csdn.net\/20150711140409831","id":"image0"},{"imagesurl":"http:\/\/img.blog.csdn.net\/20150711140741945","id":"image1"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":5,"total_comments":0,"category_name":"\u5f00\u53d1\u6280\u672f\u4ea4\u6d41","post_date":"2016-03-15","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2020\/02\/img_5e44112722964.png","avatarurls":[],"related_posts":[],"pageviews":662,"next_post_id":252,"next_post_title":"Android\u52a8\u6001\u6362\u80a4\u5f00\u6e90\u5e93Colorful\u53d1\u5e03","previous_post_id":238,"previous_post_title":"\u6536\u96c6\u56fd\u5185\u5916\u5927\u578b\u7f51\u7ad9\u67b6\u6784\u6f14\u5316\u5386\u7a0b","_links":{"self":[{"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/posts\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/comments?post=241"}],"version-history":[{"count":0,"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/posts\/241\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/media\/522"}],"wp:attachment":[{"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/media?parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/categories?post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/tags?post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}