{"id":715,"date":"2023-02-26T15:22:50","date_gmt":"2023-02-26T07:22:50","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=715"},"modified":"2023-04-29T17:16:09","modified_gmt":"2023-04-29T09:16:09","slug":"android-activity-appearance-settings","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/26\/android-activity-appearance-settings\/","title":{"rendered":"Android Activity\u5916\u89c2\u8bbe\u7f6e"},"content":{"rendered":"<h3>Activity\u7a97\u53e3\u5316<\/h3>\n<pre><code class=\"language-xml\">&lt;activity\n    android:name=&quot;com.\u2026.DialogActivity&quot;\n    android:theme=&quot;android:theme=&quot;@style\/Theme.AppCompat.Dialog&quot;\n    \/&gt;<\/code><\/pre>\n<p><!-- more --><\/p>\n<h3>Activity\u80cc\u666f\u900f\u660e<\/h3>\n<pre><code class=\"language-xml\">&lt;!-- Base application theme. --&gt;\n&lt;style name=&quot;AppTheme&quot; parent=&quot;Theme.AppCompat.Light.NoActionBar&quot;&gt;\n    &lt;item name=&quot;colorPrimary&quot;&gt;@color\/colorPrimary&lt;\/item&gt;\n    &lt;item name=&quot;colorPrimaryDark&quot;&gt;@color\/colorPrimaryDark&lt;\/item&gt;\n    &lt;item name=&quot;colorAccent&quot;&gt;@color\/colorAccent&lt;\/item&gt;\n&lt;\/style&gt;\n\n&lt;style name=&quot;AppTheme.Transparent&quot; parent=&quot;AppTheme&quot;&gt;\n    &lt;item name=&quot;android:windowBackground&quot;&gt;@color\/transparent&lt;\/item&gt;\n    &lt;item name=&quot;android:windowNoTitle&quot;&gt;true&lt;\/item&gt;\n    &lt;item name=&quot;android:windowIsTranslucent&quot;&gt;true&lt;\/item&gt;\n&lt;\/style&gt;<\/code><\/pre>\n<h3>Activity\u53ea\u6709\u4e00\u4e2a\u50cf\u7d20\u70b9<\/h3>\n<pre><code class=\"language-java\">@Override\nprotected void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    \/\/setContentView(R.layout.activity_main);\n\n    Window window = getWindow();\n    window.setGravity(Gravity.LEFT|Gravity.TOP);\n    LayoutParams params = window.getAttributes();\n    params.height = 1;\n    params.width = 1;\n    params.x = 0;\n    params.y = 0;\n\n    window.setAttributes(params);\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Activity\u7a97\u53e3\u5316 &lt;activity android:name=&quot;com.\u2026.Dialo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[119],"tags":[60],"class_list":["post-715","post","type-post","status-publish","format-standard","hentry","category-android-ui","tag-activity"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=715"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/715\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}