課程
/移動(dòng)開發(fā)
/Android
/Android攻城獅的第一門課(入門篇)
顯示文本以及輸入文本 那個(gè)標(biāo)題怎么設(shè)置
2017-07-20
源自:Android攻城獅的第一門課(入門篇) 3-3
正在回答
這樣嗎?
在res/values/strings.xml里
<resources> ????<string?name="app_name">顯示文本以及輸入文本</string> ????... </resources>
慕移動(dòng)5669817 提問者
慕田峪630870 回復(fù) 慕移動(dòng)5669817 提問者
還有一種方法,在AndroidManifest.xml?修改也可以實(shí)現(xiàn) <?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>
但一般不推薦,推薦將字符串獨(dú)立成資源。
這里主要讓你知道原理。
你想修改的是Activity頁(yè)面的label ,而label 的值是 @string資源文件下的 app_name ,app_name的值是”顯示文本以及輸入文本“。
不懂可以繼續(xù)問我 :)
舉報(bào)
想快速掌握Android應(yīng)用開發(fā)基礎(chǔ),選擇學(xué)習(xí)這門課程就對(duì)了。
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2017-07-20
這樣嗎?
在res/values/strings.xml里
2017-07-23
但一般不推薦,推薦將字符串獨(dú)立成資源。
這里主要讓你知道原理。
你想修改的是Activity頁(yè)面的label ,而label 的值是 @string資源文件下的 app_name ,app_name的值是”顯示文本以及輸入文本“。
不懂可以繼續(xù)問我 :)