英文:
How can I hide the app name in androidstudio?
问题
Sure, here's the translated content:
我需要帮助,如何在不删除名称的情况下隐藏应用程序名称。
字符串名称 = "app_name"
就像这样。感谢直接的答案。
英文:
i need help how can hide app name without delete name in
string name="app_name"
like this . Thanks for the straightforward answer .
答案1
得分: 1
如另一位用户先前提到的,您可以通过编程方式实现:
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
public class ActivityName extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 去除标题
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
}
}
或者您可以通过您的 AndroidManifest.xml 文件来实现:
<activity android:name=".ActivityName"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
</activity>
英文:
As mentioned previously by another user, you can do it programatically:
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
public class ActivityName extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// remove title
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
}
}
Or you can do it via your AndroidManifest.xml file:
<activity android:name=".ActivityName"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
</activity>
答案2
得分: 0
尝试修改你的应用的 AndroidManifest.xml
文件:
<application
android:label=""
(...)
>
这样,你就不需要修改字符串资源文件中的 <string name="app_name">app name</string>
条目了。
英文:
Try to modify your app's AndroidManifest.xml
here:
<application
android:label="@string/app_name"
(...)
>
to below:
<application
android:label=""
(...)
>
Thus you don't need to touch the entry in <string name="app_name">app name</string>
in the string resource file.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论