首页 文章 精选 留言 我的

精选列表

搜索[UI库],共10000篇文章
优秀的个人博客,低调大师

在Kubernetes上运行SAP UI5应用(上)

2018年只剩最后30天了。Jerry在2017年的最后一天,曾经立下一个目标:这个微信公众号在2018年保证至少每周发布一篇SAP原创技术文章。 从Jerry在后台统计的2018全年文章数量来看,这个目标已经提前实现了。为了感谢大家的支持,在2018年的最后一天,Jerry会发布一个合集:《SAP成都研究院2018年XX篇原创文章合集》,包含了2018年全年SAP成都研究院的同事们发布过的文章。 Jerry在11月份中旬去SAP上海研究院参加了Kubernetes的内部培训(详情参考我的前一篇文章:站在巨人肩膀上的牛顿:Kubernetes和SAP Kyma)。在SAP上海研究院的同事们如果想参加这个内部培训,可以联系同事Yang Katie。 为了避免很快就把三位老师传授的知识忘得精光,我得给自己找点练习来巩固所学的东西。 Jerry

优秀的个人博客,低调大师

Android UI-仿微信底部导航栏布局

现在App基本的标配除了侧滑菜单,还有一个就是底部导航栏,常见的聊天工具QQ,微信,购物App都有底部导航栏,用户可以随便切换看不同的内容,说是情怀也好,用户体验也罢。我们开发的主要的还是讲的是如何如何实现其功能,网上实现的方式无外乎两种,一种是使用tabhost进行切换,一种是直接使用Fragment进行切换,底部导航栏的布局有的使用的是线性布局,有的是使用的RadioGroup,本文中是使用fragment+RadioGroup是实现的,看正文吧: 基础布局 其中主要低 底部导航栏,其他都没有什么,上面是一个Fragment自己替换一下即可,关于Fragment的使用可参考本人之前的博客; activity_main.xml中的布局文件,由于样式比较多可以单独的放在style中的,鉴于方便查看,直接放在布局文件中,activity_main中的代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "fill_parent" android:layout_height= "fill_parent" android:orientation= "vertical" tools:context= "com.example.googlebottomfragment.MainActivity" > <FrameLayout android:id= "@+id/main_content" android:layout_width= "fill_parent" android:layout_height= "0dp" android:layout_weight= "1" /> <RadioGroup android:id= "@+id/tab_menu" android:layout_width= "fill_parent" android:layout_height= "wrap_content" android:background= "@drawable/mmfooter_bg" android:orientation= "horizontal" > <RadioButton android:id= "@+id/rbChat" android:layout_width= "0dp" android:layout_height= "wrap_content" android:layout_gravity= "bottom" android:layout_weight= "1" android:background= "@drawable/tab_selector_checked_bg" android:button= "@null" android:checked= "true" android:drawableTop= "@drawable/tab_selector_weixing" android:gravity= "center_horizontal|bottom" android:paddingTop= "2dp" android:text= "微信" android:textColor= "@color/tab_selector_tv_color" /> <RadioButton android:id= "@+id/rbAddress" android:layout_width= "0dp" android:layout_height= "wrap_content" android:layout_gravity= "bottom" android:layout_weight= "1" android:background= "@drawable/tab_selector_checked_bg" android:button= "@null" android:drawableTop= "@drawable/tab_selector_tongxunlu" android:gravity= "center_horizontal|bottom" android:paddingTop= "2dp" android:text= "通讯录" android:textColor= "@color/tab_selector_tv_color" /> <RadioButton android:id= "@+id/rbFind" android:layout_width= "0dp" android:layout_height= "wrap_content" android:layout_gravity= "bottom" android:layout_weight= "1" android:background= "@drawable/tab_selector_checked_bg" android:button= "@null" android:drawableTop= "@drawable/tab_selector_faxian" android:gravity= "center_horizontal|bottom" android:paddingTop= "2dp" android:text= "发现" android:textColor= "@color/tab_selector_tv_color" /> <RadioButton android:id= "@+id/rbMe" android:layout_width= "0dp" android:layout_height= "wrap_content" android:layout_gravity= "bottom" android:layout_weight= "1" android:background= "@drawable/tab_selector_checked_bg" android:button= "@null" android:drawableTop= "@drawable/tab_selector_wo" android:gravity= "center_horizontal|bottom" android:paddingTop= "2dp" android:text= "我" android:textColor= "@color/tab_selector_tv_color" /> </RadioGroup> </LinearLayout> 看下新建的布局和资源文件: 其中tab_selector_tv_color.xml主要是用于控制切换的时候显示下面字体的颜色: 1 2 3 4 5 6 7 8 <?xml version= "1.0" encoding= "utf-8" ?> <selector xmlns:android= "http://schemas.android.com/apk/res/android" > <item android:state_checked= "true" android:color= "@android:color/white" /> <item android:state_checked= "false" android:color= "@android:color/darker_gray" /> <item android:color= "@android:color/darker_gray" /> </selector> 其中tab_selector_checked_bg.xml布局文件选中的时候每个RadioButtton的背景颜色: 1 2 3 4 5 6 7 8 <?xml version= "1.0" encoding= "utf-8" ?> <selector xmlns:android= "http://schemas.android.com/apk/res/android" > <item android:state_checked= "true" android:drawable= "@drawable/tab_bg_halo" /> </selector> 其中tab_selector_weixing.xml主要是点击的时候显示不同的图片,一个是绿色的,一个是白色: 1 2 3 4 5 6 <?xml version= "1.0" encoding= "utf-8" ?> <selector xmlns:android= "http://schemas.android.com/apk/res/android" > <item android:state_checked= "false" android:drawable= "@drawable/tab_weixin_normal" ></item> <item android:state_checked= "true" android:drawable= "@drawable/tab_weixin_pressed" ></item> </selector> 其中需要切换的chat.xml,address.xml,find.xml,me.xml都是一样的,其中chat.xml代码如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 <?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_height= "wrap_content" android:layout_width= "wrap_content" android:text= "微信" android:textSize= "20sp" /> <TextView android:layout_height= "wrap_content" android:layout_width= "wrap_content" android:text= "http://www.cnblogs.com/xiaofeixiang" android:textSize= "15sp" /> </LinearLayout> 实现Demo MainActivity.java中的代码,主要的就是设置一下OnCheckedChangeListener,注意MainActivity中需要继承FragmentActivity: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 public void initView() { chat = new FragmentChat(); getSupportFragmentManager().beginTransaction().replace(R.id.main_content, chat).commit(); myTabRg = (RadioGroup) findViewById(R.id.tab_menu); myTabRg.setOnCheckedChangeListener( new OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub switch (checkedId) { case R.id.rbChat: chat = new FragmentChat(); getSupportFragmentManager().beginTransaction().replace(R.id.main_content, chat) .commit(); break ; case R.id.rbAddress: if (address== null ) { address = new FragmentAddress(); } Log.i( "MyFragment" , "FragmentAddress" ); getSupportFragmentManager().beginTransaction().replace(R.id.main_content, address).commit(); break ; case R.id.rbFind: find = new FragmentFind(); getSupportFragmentManager().beginTransaction().replace(R.id.main_content, find) .commit(); break ; case R.id.rbMe: me = new FragmentMe(); getSupportFragmentManager().beginTransaction().replace(R.id.main_content, me) .commit(); break ; default : break ; } } }); FragmentChat中的代码,其余的三个FragmentAddress,FragmentFind,FragmentMe类似,就不贴代码了,主要是继承Fragment 即可: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 public class FragmentChat extends Fragment { @Override public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super .onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // TODO Auto-generated method stub return inflater.inflate(R.layout.chat, null ); } } 最后看张通讯录的截图吧: 、- 本文转自Fly_Elephant博客园博客,原文链接:http://www.cnblogs.com/xiaofeixiang/p/4156732.html,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册