首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    Android’s PreferenceActivity for all API versions

    I have spent the last few days learning about how to use the new Android PreferenceFragment which requires PreferenceActivity to override a new v11 (Honeycomb) method called onBuildHeaders(). Unfortunately, the documentation is not very clear how one would create a single PreferenceActivity that could play well in all versions, utilizing the newest features if you have it and avoiding an app crash on older Android versions. I encountered several solutions to this issue by creating two different activities for the two different mechanisms requiring two entries in your AndroidManifest.xml file. Having two different PreferenceActivities means if you have library code that extends that class, you now have to duplicate it. Then, if your app descends your library class, now has to be duplicated yet again. The end result is … less than ideal.

    01

    Android开发笔记(六十七)嵌入页面的碎片

    Android从3.0之后引入了Fragment,可以把它理解为页面的一个片段,比如一个html网页就包含一个header头部片段,以及一个body身体片段。 设计Fragment的目的是让页面布局更加灵活,不但可以随意组装和拼接各个片段,还可以只更新某个片段实现页面局部更新的功能(这个类似网页的ajax技术)。Fragment可以协助我们完成如下任务: 1、在一个页面中嵌入多个连续可翻页的子视图,方面使用ViewPager统一管理; 2、开发一些通用的小部件,内部封装好代码逻辑,可直接嵌入到任意页面。比如广告、地图等组件; 3、同一套代码可适配不同尺寸的屏幕,比如说同时适配竖屏与横屏,同时适配手机与平板等等;

    06

    全屏、沉浸式、fitSystemWindow使用及原理分析:全方位控制“沉浸式”的实现

    状态栏与导航栏属于SystemUi的管理范畴,虽然界面的UI会受到SystemUi的影响,但是,APP并没有直接绘制SystemUI的权限与必要。APP端之所以能够更改状态栏的颜色、导航栏的颜色,其实还是操作自己的View更改UI。可以这么理解:状态栏与导航栏拥有自己独立的窗口,而且这两个窗口的优先级较高,会悬浮在所有窗口之上,可以把系统自身的状态栏与导航栏看做全透明的,之所有会有背景颜色,是因为下层显示界面在被覆盖的区域添加了颜色,之后,通过SurfaceFlinger的图层混合,好像是状态栏、导航栏自身有了背景色。看一下一个普通的Activity展示的时候,所对应的Surface(或者说Window也可以)。

    04
    领券