自定义View仿TabHost的实现(二)
2012-12-27 11:45
92 查看
activity_1.xml如下:
activity_2.xml如下:
activity_3.xml如下:
activity_4.xml如下:
bottommenu.xml如下:
manifest.xml如下:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:text="Activity 1" android:textSize="50sp" /> <cn.com.BottomMenuView android:layout_width="fill_parent" android:layout_height="70dip" android:layout_alignParentBottom="true" /> </RelativeLayout>
activity_2.xml如下:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:text="Activity 2" android:textSize="50sp" /> <cn.com.BottomMenuView android:layout_width="fill_parent" android:layout_height="70dip" android:layout_alignParentBottom="true" /> </RelativeLayout>
activity_3.xml如下:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:text="Activity 3" android:textSize="50sp" /> <cn.com.BottomMenuView android:layout_width="fill_parent" android:layout_height="70dip" android:layout_alignParentBottom="true" /> </RelativeLayout>
activity_4.xml如下:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:text="Activity 4" android:textSize="50sp" /> <cn.com.BottomMenuView android:layout_width="fill_parent" android:layout_height="70dip" android:layout_alignParentBottom="true" /> </RelativeLayout>
bottommenu.xml如下:
<?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="70dip" android:orientation="horizontal" > <LinearLayout android:id="@+id/menu_LinearLayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:clickable="true" android:background="@drawable/photo1" android:layout_weight="1" /> <LinearLayout android:id="@+id/menu_LinearLayout2" android:layout_width="match_parent" android:layout_height="wrap_content" android:clickable="true" android:background="@drawable/photo2" android:layout_weight="1" /> <LinearLayout android:id="@+id/menu_LinearLayout3" android:layout_width="match_parent" android:layout_height="wrap_content" android:clickable="true" android:background="@drawable/photo3" android:layout_weight="1" /> <LinearLayout android:id="@+id/menu_LinearLayout4" android:layout_width="match_parent" android:layout_height="wrap_content" android:clickable="true" android:background="@drawable/photo4" android:layout_weight="1" /> </LinearLayout>
manifest.xml如下:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="cn.com" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".Activity1"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".Activity2"> </activity> <activity android:name=".Activity3"> </activity> <activity android:name=".Activity4"> </activity> </application> </manifest>
相关文章推荐
- 使用自定义RadioButton和ViewPager实现TabHost效果和带滑动的页卡效果。
- 自定义View仿TabHost的实现(二)
- 使用自定义RadioButton和ViewPager实现TabHost效果和带滑动的页卡效果。
- 使用自定义RadioButton和ViewPager实现TabHost效果和带滑动的页卡效果
- 自定义FragmentTabHost--实现View重复加载问题
- android Tabhost部件(三)--使用自定义view和fragement实现类似TabHost样式
- 自定义RadioButton和ViewPager实现TabHost带滑动的页卡效果
- 使用自定义RadioButton和ViewPager实现TabHost效果和带滑动的页卡效果。
- Android实战简易教程-第三十二枪(自定义View登录注册界面EditText-实现一键清空)
- 自定义view实现开关按钮并监听(有滑动效果)
- UIImageView动画 、自定义View 和手势的简单实用 Tom 猫 全部功能实现
- 自定义View实现水波纹下载进度效果
- Android 自定义view实现动态水球效果
- [AndroidUI]自定义view(三):实现圆环进度条
- Android 实现自定义View
- 自定义ViewGroup实现控件自动换行
- Android自定义SurfaceView——实现画板功能
- Android进阶之自定义View实战(一)仿iOS UISwitch控件实现
- 实现自定义view的自定义属性
- view实现自定义小圆点滑动