主界面HomeActivity布局
1、
HomeActivity.java
|
2、布局 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#ff1100"
android:gravity="center"
android:text="@string/activity_home"
android:textColor="#00ff00"
android:textSize="20sp" />
<cn.zengfansheng.mobilesafe.ui.FocusedTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:text="@string/home_title" />
<GridView
android:verticalSpacing="20dip"
android:id="@+id/gv_home_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:numColumns="3" >
</GridView>
</LinearLayout>
|
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
tools:ignore="UseCompoundDrawables" >
<ImageView
android:id="@+id/iv_icon_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/app_icon"
android:src="@drawable/app_manager" />
<TextView
android:textColor="#000000"
android:id="@+id/tv_name_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
|