Java 如何设置应用程序以全屏运行
你好,我有一个问题,我正在创建一个应用程序,将重复景观视频作为背景,但我不知道如何设置在全屏。我正在Android studio中创建应用程序。应用程序将有这样的风景>试试这个 方式1。在清单中设置Java 如何设置应用程序以全屏运行,java,android,Java,Android,你好,我有一个问题,我正在创建一个应用程序,将重复景观视频作为背景,但我不知道如何设置在全屏。我正在Android studio中创建应用程序。应用程序将有这样的风景>试试这个 方式1。在清单中设置 <activity ... android:theme="@android:style/Theme.NoTitleBar.Fullscreen" /> <activity android:name=".LoginActivity" android:them
<activity
...
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity android:name=".LoginActivity"
android:theme="@style/theme_fullScreen"/>
方式3。在清单中设置,并在样式中设置
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="theme_fullScreen" parent="android:Theme.Black">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
</resources>
真的
真的
在舱单上
<activity
...
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity android:name=".LoginActivity"
android:theme="@style/theme_fullScreen"/>
注意
- 更改
活动的
android:theme
- 设置
getWindow().setFlags(WindowManager.LayoutParams.FILL\u父项,WindowManager.LayoutParams.FILL\u父项)代码>
- style.xml
}<!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> <style name="AppTheme.FullScreen" parent="AppTheme"> <item name="android:windowFullscreen">true</item> </style>
- activity_main.xml
`
- 给你
要播放视频,请在“res”文件夹下创建一个文件夹名“raw”。在“原始”文件夹下复制视频。请将视频名称保留为小字符。一旦完成,请做以下修改
这就是你想要的吗?开始用你的投票权来使用它吧?你好@NileshRathod。我已经观察你很久了。我很高兴与你交流。我不生气。你很好。很抱歉我的英语很差。@NileshRathodenjoy codding很高兴与您交流,以帮助我
<VideoView
android:id="@+id/videoView"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:textSize="30dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"></TextView>
</android.support.constraint.ConstraintLayout>