Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我在 android 操作系统上启动我的应用程序时,它占据了整个可用屏幕。这是不希望的。我希望我的应用程序只占据屏幕的一部分,比如“10,10,100,100”的矩形。那么如何实现呢?
通过在文件中声明主题,您可以将对话框主题用于单个 Activity AndroidManifest.xml:
AndroidManifest.xml
<activity android:theme="@android:style/Theme.Dialog" android:name="your.package.and.ActivityName"/>
这会让你Activity看起来像一个Dialog.
Activity
Dialog