//styles.xml
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<style name="big_red_font">
<item name="android:textColor">#ff0000</item>
<item name="android:textSize">20sp</item>
</style>
</resources>
//main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
style="@style/big_red_font"
/>
</LinearLayout>
//styles.xml
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<style name="big_red_font">
<item name="android:textColor">#ff0000</item>
<item name="android:textSize">20sp</item>
</style>
<style name="Theme">
<item name="android:windowNoTitle">true</item>
</style>
<style name="Theme.big" parent="Theme">
<item name="android:textSize">20sp</item>
<item name="android:textStyle">italic</item>
</style>
</resources>//AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.chulbeom.cho"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".DemoAppEx1Activity"
android:theme="@style/Theme.big"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
//DemoAppEx1Activity.java
import android.app.Activity;
import android.os.Bundle;
public class DemoAppEx1Activity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(R.style.Theme_big);
setContentView(R.layout.main);
}
}
[Android] Edit Text (0) | 2011.08.09 |
---|---|
[Android] Button (0) | 2011.08.03 |
[Android]자바 코드에서 직접 뷰를 추가하는 방법 (0) | 2011.07.31 |
[Andorid] AutoCompleteTextView (0) | 2011.07.30 |
[Android] 뷰 (0) | 2011.07.26 |
댓글 영역