700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 使用ActivityGroup来切换Activity和Layout android入门开发与实战

使用ActivityGroup来切换Activity和Layout android入门开发与实战

时间:2018-11-07 05:07:18

相关推荐

使用ActivityGroup来切换Activity和Layout android入门开发与实战

–> <? xml version="1.0" encoding="utf-8" ?>

< LinearLayout xmlns:android =“/apk/res/android”

android:layout_width =“fill_parent” android:orientation =“vertical”

android:layout_height =“fill_parent” >

< LinearLayout android:gravity =“center_horizontal”

android:background ="@drawable/myinfor2" android:layout_width =“fill_parent”

android:layout_height =“wrap_content” >

< TextView android:id ="@+id/cust_title" android:textColor ="@android:color/white"

android:textSize =“28sp” android:text =“模块1” android:layout_width =“wrap_content”

android:layout_height =“wrap_content” ></ TextView >

</ LinearLayout >

< ScrollView android:measureAllChildren =“true” android:id ="@+id/containerBody"

android:layout_weight =“1” android:layout_height =“fill_parent”

android:layout_width =“fill_parent” >

</ ScrollView >

< LinearLayout android:background ="@android:color/black"

android:layout_gravity =“bottom” android:orientation =“horizontal”

android:layout_width =“fill_parent” android:layout_height =“wrap_content” >

< ImageView android:id ="@+id/btnModule1" android:src ="@android:drawable/ic_dialog_dialer"

android:layout_marginLeft =“7dp” android:layout_marginTop =“3dp”

android:layout_marginBottom =“3dp” android:layout_width =“wrap_content”

android:layout_height =“wrap_content” />

< ImageView android:id ="@+id/btnModule2" android:src ="@android:drawable/ic_dialog_info"

android:layout_marginLeft =“7dp” android:layout_marginTop =“3dp”

android:layout_marginBottom =“3dp” android:layout_width =“wrap_content”

android:layout_height =“wrap_content” />

< ImageView android:id ="@+id/btnModule3" android:src ="@android:drawable/ic_dialog_alert"

android:layout_marginLeft =“7dp” android:layout_marginTop =“3dp”

android:layout_marginBottom =“3dp” android:layout_width =“wrap_content”

android:layout_height =“wrap_content” />

</ LinearLayout >

</ LinearLayout >

2.2TestView.java

/\*\*\* 使用ActivityGroup来切换Activity和Layout

* @author 农民伯伯

* @version -9-7

*

*/

public class TestView extends ActivityGroup {

private ScrollView container = null ;

@Override

protected void onCreate(Bundle savedInstanceState) {

super .onCreate(savedInstanceState);

// 隐藏标题栏

requestWindowFeature(Window.FEATURE_NO_TITLE);

// 设置视图

setContentView(R.layout.layout);

container = (ScrollView) findViewById(R.id.containerBody);

// 模块1

ImageView btnModule1 = (ImageView) findViewById(R.id.btnModule1);

btnModule1.setOnClickListener( new OnClickListener() {

@Override

public void onClick(View v) {

container.removeAllViews();

container.addView(getLocalActivityManager().startActivity(

" Module1 " ,

new Intent(TestView. this , ModuleView1. class )

.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))

.getDecorView());

}

});

总结

算法知识点繁多,企业考察的题目千变万化,面对越来越近的“金九银十”,我给大家准备好了一套比较完善的学习方法,希望能帮助大家在有限的时间里尽可能系统快速的恶补算法,通过高效的学习来提高大家面试中算法模块的通过率。

这一套学习资料既有文字档也有视频,里面不仅仅有关键知识点的整理,还有案例的算法相关部分的讲解,可以帮助大家更好更全面的进行学习,二者搭配起来学习效果会更好。

部分资料展示:

有了这套学习资料,坚持刷题一周,你就会发现自己的算法知识体系有明显的完善,离大厂Offer的距离更加近。

3l2LFr53-1643890375191)]

[外链图片转存中…(img-E1cJ8DAr-1643890375192)]

[外链图片转存中…(img-CKWdROBo-1643890375192)]

有了这套学习资料,坚持刷题一周,你就会发现自己的算法知识体系有明显的完善,离大厂Offer的距离更加近。

本文已被CODING开源项目:《Android学习笔记总结+移动架构视频+大厂面试真题+项目实战源码》收录

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。