課程
/移動開發
/Android
/Android攻城獅的第一門課(入門篇)
顯示文本以及輸入文本 那個標題怎么設置
2017-07-20
源自:Android攻城獅的第一門課(入門篇) 3-3
正在回答
這樣嗎?
在res/values/strings.xml里
<resources> ????<string?name="app_name">顯示文本以及輸入文本</string> ????... </resources>
慕移動5669817 提問者
慕田峪630870 回復 慕移動5669817 提問者
還有一種方法,在AndroidManifest.xml?修改也可以實現 <?xml?version="1.0"?encoding="utf-8"?> <manifest?xmlns:android="http://schemas.android.com/apk/res/android" ????package="com.example.mycalculator3" ????android:versionCode="1" ????android:versionName="1.0"?> ????<uses-sdk ????????android:minSdkVersion="14" ????????android:targetSdkVersion="19"?/> ????<application ????????android:allowBackup="true" ????????android:icon="@drawable/ic_launcher" ????????android:label="@string/app_name" ????????android:theme="@style/AppTheme"?> ????????<activity ????????????android:name="com.example.mycalculator3.MainActivity" ????????????android:theme="@android:style/Theme.Black.NoTitleBar" ????????????android:label="顯示文本以及輸入文本"?> ????????????<intent-filter> ????????????????<action?android:name="android.intent.action.MAIN"?/> ????????????????<category?android:name="android.intent.category.LAUNCHER"?/> ????????????</intent-filter> ????????</activity> ????</application> </manifest>
但一般不推薦,推薦將字符串獨立成資源。
這里主要讓你知道原理。
你想修改的是Activity頁面的label ,而label 的值是 @string資源文件下的 app_name ,app_name的值是”顯示文本以及輸入文本“。
不懂可以繼續問我 :)
舉報
想快速掌握Android應用開發基礎,選擇學習這門課程就對了。
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-07-20
這樣嗎?
在res/values/strings.xml里
2017-07-23
但一般不推薦,推薦將字符串獨立成資源。
這里主要讓你知道原理。
你想修改的是Activity頁面的label ,而label 的值是 @string資源文件下的 app_name ,app_name的值是”顯示文本以及輸入文本“。
不懂可以繼續問我 :)