FragmentDemo.zip

上传者: lvqing323 | 上传时间: 2021-07-10 14:00:39 | 文件大小: 146KB | 文件类型: ZIP
Android Studio 4.2.1 with Gradle 6.7.1 Fragment界面切换实例。过程说明见:https://blog.csdn.net/lvqing323/article/details/118627931 Fragment是Android3.0后引入的一个新的API,他出现的初衷是为了适应大屏幕的平板电脑, 当然现在他仍然是平板APP UI设计的宠儿,而且我们普通手机开发也会加入这个Fragment, 我们可以把他看成一个小型的Activity,又称Activity片段!想想,如果一个很大的界面,我们 就一个布局,写起界面来会有多麻烦,而且如果组件多的话是管理起来也很麻烦!而使用Fragment 我们可以把屏幕划分成几块,然后进行分组,进行一个模块化的管理!从而可以更加方便的在 运行过程中动态地更新Activity的用户界面!另外Fragment并不能单独使用,他需要嵌套在Activity 中使用,尽管他拥有自己的生命周期,但是还是会受到宿主Activity的生命周期的影响,比如Activity 被destory销毁了,他也会跟着销毁! ———————————————— 版权声明:本文为CSDN博主「greenby0207」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/lvqing323/article/details/118627931

文件下载

资源详情

[{"title":"( 43 个子文件 146KB ) FragmentDemo.zip","children":[{"title":"FragmentDemo4","children":[{"title":".gitignore <span style='color:#111;'> 240B </span>","children":null,"spread":false},{"title":"app","children":[{"title":".gitignore <span style='color:#111;'> 6B </span>","children":null,"spread":false},{"title":"build.gradle <span style='color:#111;'> 1.33KB </span>","children":null,"spread":false},{"title":"src","children":[{"title":"androidTest","children":[{"title":"java","children":[{"title":"cn","children":[{"title":"greenby","children":[{"title":"fragmentdemo4","children":[{"title":"ExampleInstrumentedTest.java <span style='color:#111;'> 787B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"main","children":[{"title":"AndroidManifest.xml <span style='color:#111;'> 874B </span>","children":null,"spread":false},{"title":"res","children":[{"title":"mipmap-xhdpi","children":[{"title":"ic_launcher_round.png <span style='color:#111;'> 7.30KB </span>","children":null,"spread":false},{"title":"ic_launcher.png <span style='color:#111;'> 4.81KB </span>","children":null,"spread":false}],"spread":true},{"title":"mipmap-mdpi","children":[{"title":"ic_launcher_round.png <span style='color:#111;'> 3.31KB </span>","children":null,"spread":false},{"title":"ic_launcher.png <span style='color:#111;'> 2.57KB </span>","children":null,"spread":false}],"spread":true},{"title":"layout","children":[{"title":"activity_main.xml <span style='color:#111;'> 2.12KB </span>","children":null,"spread":false},{"title":"fragment_internet.xml <span style='color:#111;'> 541B </span>","children":null,"spread":false},{"title":"fragment_contact.xml <span style='color:#111;'> 539B </span>","children":null,"spread":false},{"title":"fragment_telephone.xml <span style='color:#111;'> 542B </span>","children":null,"spread":false}],"spread":true},{"title":"mipmap-xxhdpi","children":[{"title":"ic_launcher_round.png <span style='color:#111;'> 11.59KB </span>","children":null,"spread":false},{"title":"ic_launcher.png <span style='color:#111;'> 7.72KB </span>","children":null,"spread":false}],"spread":true},{"title":"menu","children":[{"title":"menu_main.xml <span style='color:#111;'> 421B </span>","children":null,"spread":false}],"spread":false},{"title":"drawable","children":[{"title":"ic_launcher_background.xml <span style='color:#111;'> 5.64KB </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-anydpi-v26","children":[{"title":"ic_launcher_round.xml <span style='color:#111;'> 276B </span>","children":null,"spread":false},{"title":"ic_launcher.xml <span style='color:#111;'> 276B </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-v24","children":[{"title":"ic_launcher_foreground.xml <span style='color:#111;'> 1.69KB </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-hdpi","children":[{"title":"ic_launcher_round.png <span style='color:#111;'> 5.21KB </span>","children":null,"spread":false},{"title":"ic_launcher.png <span style='color:#111;'> 3.51KB </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-xxxhdpi","children":[{"title":"ic_launcher_round.png <span style='color:#111;'> 16.18KB </span>","children":null,"spread":false},{"title":"ic_launcher.png <span style='color:#111;'> 10.40KB </span>","children":null,"spread":false}],"spread":false},{"title":"navigation","children":[{"title":"nav_graph.xml <span style='color:#111;'> 1.05KB </span>","children":null,"spread":false}],"spread":false},{"title":"values-night","children":[{"title":"themes.xml <span style='color:#111;'> 850B </span>","children":null,"spread":false}],"spread":false},{"title":"values","children":[{"title":"strings.xml <span style='color:#111;'> 692B </span>","children":null,"spread":false},{"title":"colors.xml <span style='color:#111;'> 387B </span>","children":null,"spread":false},{"title":"dimens.xml <span style='color:#111;'> 68B </span>","children":null,"spread":false},{"title":"themes.xml <span style='color:#111;'> 1.19KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"java","children":[{"title":"cn","children":[{"title":"greenby","children":[{"title":"fragmentdemo4","children":[{"title":"MainActivity.java <span style='color:#111;'> 3.08KB </span>","children":null,"spread":false},{"title":"ContactFragment.java <span style='color:#111;'> 2.08KB </span>","children":null,"spread":false},{"title":"TelephoneFragment.java <span style='color:#111;'> 2.26KB </span>","children":null,"spread":false},{"title":"InternetFragment.java <span style='color:#111;'> 2.25KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"test","children":[{"title":"java","children":[{"title":"cn","children":[{"title":"greenby","children":[{"title":"fragmentdemo4","children":[{"title":"ExampleUnitTest.java <span style='color:#111;'> 401B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"libs","children":null,"spread":false},{"title":"proguard-rules.pro <span style='color:#111;'> 770B </span>","children":null,"spread":false}],"spread":true},{"title":"settings.gradle <span style='color:#111;'> 52B </span>","children":null,"spread":false},{"title":"build.gradle <span style='color:#111;'> 1.04KB </span>","children":null,"spread":false},{"title":"gradlew <span style='color:#111;'> 5.17KB </span>","children":null,"spread":false},{"title":"gradlew.bat <span style='color:#111;'> 2.21KB </span>","children":null,"spread":false},{"title":"gradle.properties <span style='color:#111;'> 1019B </span>","children":null,"spread":false},{"title":"gradle","children":[{"title":"wrapper","children":[{"title":"gradle-wrapper.properties <span style='color:#111;'> 238B </span>","children":null,"spread":false},{"title":"gradle-wrapper.jar <span style='color:#111;'> 53.06KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明