Method for setting the size of Android pop-up activity

How to set the size of the activity so that your window no longer looks full screen. Some netizens may know that it is implemented through themes such as theme. Dialog, but tell you the principle of setting the activity not to be displayed in full screen. Android theme is mainly implemented by defining style. You can directly see the definition in the Android framework. Today, we give a simpler but relatively flexible method. For example, do not use the border in theme.dialog. Let's take a look at the implementation method of customizing the size of activity.

1. Create a style file to your project and save it in RES / values / styles.xml. The file name here cannot be modified arbitrarily. The content is. Note that UTF-8 coding is used when saving.

Java code

Java code

3. Finally, in Android manifest.xml, add an Android: theme attribute to your activity node with the value of @ style / theme.android123

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>