์๋๋ก์ด๋ ํํ ๋ฆฌ์ผ
์กํฐ๋นํฐ ๋์ฐ๊ธฐ
๋ฒํผ ํด๋ฆญ ์ด๋ฒคํธ ์ฒ๋ฆฌ
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_send"
android:onClick="sendMessage" />
/** Called when the user clicks the Send button */
public void sendMessage(View view) {
// Do something in response to button
}
IntelliJ Tip
- Local History๋ก ๋ณต์ํ๊ธฐ
- VCS Commit
Action Bar
Feature
- ์ฑ ์์ด์ฝ
- ํ์ดํ
- ๋๋๋ค์ด ๋ฉ๋ด
Set up
3.0 ์ด์
- Theme.Holo ๋๋ ์์๋ฐ์ ํ
๋ง
- minSdkVersion, targetSdkVersion ์ด 11 ์ด์
<manifest ... >
<uses-sdk android:minSdkVersion="11" ... />
...
</manifest>
2.1 ์ด์
- Android Support Library ํ์
- ActionBarActivity ์์
public class MainActivity extends ActionBarActivity { ... }
<activity android:theme="@style/Theme.AppCompat.Light" ... >
- minSdkVersion์ 7 ์ด์
<manifest ... >
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="18" />
...
</manifest>
Action Button ์ถ๊ฐ
Actions์ XML๋ก ์ ํ๊ธฐ
- res/menu/main_activity_actions.xml
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- Search, should appear as action button -->
<item android:id="@+id/action_search"
android:icon="@drawable/ic_action_search"
android:title="@string/action_search"
android:showAsAction="ifRoom" />
<!-- Settings, should always be in the overflow -->
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
android:showAsAction="never" />
</menu>
Action Bar ์คํ์ผ๋ง