- 浏览: 169153 次
- 性别:
- 来自: 北京
-
最新评论
-
wangzhengfu:
看你这文章很纠结,既然把图贴出来了,为啥不贴上代码呢
android EditText 去除边框 -
sovio:
...
android EditText 去除边框 -
kdac:
啥J8翻译啊,谷歌翻译贴出来的吧?翻译不了就放原文,不伦不类, ...
android 弹出软键盘将底部视图顶起问题 -
shiny_txdd:
17:34:47,806 ERROR [ContextLoad ...
tomcat项目转jboss5.0 -
lenomon:
这里有篇实现无下划线的,Android使用TextView实现 ...
Android TextView中文字设置超链接、颜色、字体
模仿renren的左右划动菜单栏,主要通过HorizontalScrollView来实现横向划动布局。通过判HorizontalScrollView对象的scrollX来控制左右两边的图片显隐。显示效果如图:
具体Java代码如下:
/** * * @author Shaodong Wu * 模仿renren的左右划动菜单栏 */ public class JustTestActivity extends Activity { private static final String TAG="JustTestActivity"; /** Called when the activity is first created. */ HorizontalScrollView scrollBar; RadioGroup radioGroup; int widthX; ImageView arrowl; ImageView arrowr; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); scrollBar=(HorizontalScrollView)this.findViewById(R.id.scroll_bar); radioGroup=(RadioGroup)this.findViewById(R.id.radioGroup); arrowl=(ImageView)this.findViewById(R.id.arrowl); arrowr=(ImageView)this.findViewById(R.id.arrowr); scrollBar.fling(1000); //通过判断目标的scrollX来控制左右两边的图片显隐 scrollBar.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent event) { Log.i(TAG, "scrollX ---->"+scrollBar.getScrollX()); Log.i(TAG, "windth ---->"+scrollBar.getWidth()); LinearLayout linear=(LinearLayout)scrollBar.getChildAt(0); int radioWidth= linear.getChildAt(0).getWidth(); Log.i(TAG, "radio width--->"+radioWidth); if(scrollBar.getScrollX()<6){ arrowl.setVisibility(View.GONE); }else if(scrollBar.getScrollX()+scrollBar.getWidth()>radioWidth-6){ arrowr.setVisibility(View.GONE); }else{ arrowr.setVisibility(View.VISIBLE); arrowl.setVisibility(View.VISIBLE); } return false; } }); } @Override protected void onStart() { // TODO Auto-generated method stub super.onStart(); } }
Xml布局代码如下:
<?xml version="1.0" encoding="utf-8"?> <FrameLayout android:id="@+id/frameLayout1" android:scrollbars="none" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent"> <HorizontalScrollView android:layout_width="fill_parent" android:scrollbars="none" android:fillViewport="true" android:layout_height="wrap_content" android:fadingEdge="none" android:id="@+id/scroll_bar"> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" > <RadioGroup android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/radioGroup" android:orientation="horizontal" android:gravity="center_vertical"> <RadioButton android:id="@+id/radio1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="游戏1" style="@style/main_tab_bottom"/> <RadioButton android:id="@+id/radio2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="游戏2" style="@style/main_tab_bottom"/> <RadioButton android:id="@+id/radio3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="游戏3" style="@style/main_tab_bottom"/> <RadioButton android:id="@+id/radio4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="游戏4" style="@style/main_tab_bottom"/> <RadioButton android:id="@+id/radio5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="游戏5" style="@style/main_tab_bottom"/> <RadioButton android:id="@+id/radio6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="游戏6" style="@style/main_tab_bottom"/> <RadioButton android:id="@+id/radio7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="游戏7" style="@style/main_tab_bottom"/> <RadioButton android:id="@+id/radio7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="游戏8" style="@style/main_tab_bottom"/> <RadioButton android:id="@+id/radio9" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="游戏9" style="@style/main_tab_bottom"/> </RadioGroup> </LinearLayout> </HorizontalScrollView> <ImageView android:id="@+id/arrowl" android:layout_height="wrap_content" android:visibility="gone" android:layout_width="wrap_content" android:src="@drawable/arrowl" android:layout_gravity="left|center_vertical"></ImageView> <ImageView android:layout_height="wrap_content" android:layout_gravity="right|center_vertical" android:visibility="gone" android:layout_width="wrap_content" android:src="@drawable/arrowr" android:id="@+id/arrowr"/> </FrameLayout>
完整项目见附件。
发表评论
-
Android中canvas和paint的关系及使用
2011-11-30 10:15 2244刚刚开始接触学习Android的同鞋们在看到工程中出现的那么 ... -
android 抓包
2011-07-12 10:28 39731、下载TcpDump for Android ,或者本地下 ... -
Android参数设置父布局集体宽高
2011-06-21 11:47 3429LinearLayout gridContainer = (L ... -
Android应用按返回键完全退出应用
2011-06-07 17:58 7225很多网友可能发现自己 ... -
GIT和repo使用方法,下载android-2.6.29内核
2011-06-07 14:45 1993http://hi.baidu.com/kkernel/ ... -
动态增加TableLayout的行
2011-06-02 15:43 2538Just like HTML Tables on webpag ... -
如何申请 android google map API key
2011-06-01 15:16 16181.首先要得到你的debug keystore位置: 打 ... -
Android TextView中文字设置超链接、颜色、字体
2011-05-27 12:27 5386TextView是用来显示文本的,有时需要给TextView中 ... -
设置ProgressBar的颜色
2011-05-26 10:05 2256在《Android/OPhone开发完全讲义》 ... -
Android 调用系统的照相,浏览图片,转存并裁剪!
2011-05-25 12:59 4600public class AddCardActivity ex ... -
修改TabHost默认样式
2011-05-10 13:52 3200TabHost是Android提供的一个容器组件, ... -
Android控件美化Shape
2011-05-04 09:59 1209当然除了使用drawable这样的图片外今天谈下自定义图形 ... -
android开发中WebView的使用(附完整程序)
2011-05-03 14:00 2114WebView是个好东西,作用相当于一个迷你的浏览器,采用We ... -
android 弹出软键盘将底部视图顶起问题
2011-04-19 13:20 6958今天要做一个搜索功能,搜索界面采用AutoCompleteTe ... -
自定义ListView行间的分割线
2011-04-18 10:18 1607在Android平台中系统控件提供了灵活的自定义选项,所有 ... -
android xml中应用占位符
2011-04-02 18:24 1568Formatting and Styling Here ar ... -
android Toast大全(五种情形)建立属于你自己的Toast
2011-04-02 18:18 934Toast用于向用户显示一些帮助/提示。下面我做了5中效果,来 ... -
JadEclipse工具的使用
2011-04-01 11:49 2566JadEclipse工具的使用 1、下载工具 JadEcl ... -
Android 反编译apk 到java源码的方法
2011-04-01 11:20 969Android由于其代码是放在dalvik虚拟机上的托管代码, ... -
Android dex ,xml 文件反编译方法【转】
2011-04-01 11:19 1522Dex 文件是Android上运行于delvik的java二进 ...
相关推荐
"仿人人滑动菜单"项目是针对人人网(Renren.com)Android客户端的滑动菜单效果进行的模仿实现,它集成了手指滑动以及按钮点击两种方式来打开和关闭菜单,提升了用户的交互体验。 首先,让我们深入理解滑动菜单的...
本文将深入探讨在研究"android 人人 renren 源码"时可能遇到的关键知识点。 1. **Android SDK和版本兼容性**: 人人网的源码基于特定版本的Android SDK,因此在运行或分析源码前,需要确保你拥有匹配的开发环境。...
在本项目中,“Android代码-模仿人人安卓客户端程序”是一个旨在复现人人网安卓客户端功能的开源项目。从描述中的字符串“c171dfe974f6f0bede63cb5e8d3d31ff6e8c84f3”来看,这可能是该项目的Git提交哈希值,用于...
例如,人人网的滑动导航菜单可能需要自定义一个侧滑菜单视图,实现手势滑动效果和动画过渡。 4. **图片加载库**:为了高效地加载网络图片,开发者通常会使用第三方库如Glide或Picasso,它们能优化内存使用,防止...
《Renren-api-android SDK详解与应用实践》 在移动互联网时代,社交网络平台的重要性不言而喻,其中,人人网(Renren)作为中国早期的社交网络巨头,为开发者提供了丰富的API接口,使得第三方应用能够与其平台进行...
在本压缩包“renren.zip”中,我们主要关注的是Android应用的源码分析,特别是针对“RenRen”这个项目。作为一个专注于分享Android应用开发的知识点,我们可以从以下几个方面进行深入探讨: 1. **Android应用的基本...
"android RenRen源码.rar"是一个与人人网(RenRen)相关的Android应用程序源码包,对于深入理解社交应用的实现机制、Android开发以及网络通信等方面具有很高的学习价值。 首先,我们要明确的是,人人网是一款知名的...
"安卓Android源码——RenRen.zip" 提供的是针对人人网(RenRen)这款应用的相关源代码,这对于开发者来说是一份宝贵的资源,能够帮助他们学习如何在Android平台上构建社交网络应用。 首先,Android源码包含了一系列...
- **菜单管理**:renren-fast的菜单管理允许开发者根据角色动态生成前端菜单,使得不同权限级别的用户看到的菜单结构各不相同。菜单的层级结构有助于组织和导航系统的功能。 **总结** renren-fast项目提供了全面的...
### 知识点一:人人网Android SDK 2.0概述 人人网Android SDK 2.0是一个适用于Android开发者的SDK工具包,它允许开发者在其应用中集成人人网的社交功能,比如发布状态、上传照片等。使用这一SDK,开发者可以不需深入...
Android应用源码之renren.zip项目安卓应用源码下载Android应用源码之renren.zip项目安卓应用源码下载 1.适合学生毕业设计研究参考 2.适合个人学习研究参考 3.适合公司开发项目技术参考
"renren"项目是一个典型的Android应用源码示例,适用于计算机专业学生的毕业设计学习。它提供了实际的代码实现,可以帮助学习者深入理解Android应用的架构、功能模块以及交互流程。 首先,从“Android 源码”的角度...
标题“renren_renren08com_java_”暗示了这是一个与人人网(renren08.com)相关的Java项目,可能涉及到网站的后端开发。描述提到的功能是关于网络运行状态监控,它能够生成网络健康报告,统计网络中排名前10的应用...
本文将基于“renren-fast2.1-完整版”和“renren-security3.2完整版”的开发文档,深入解析这两个轻量级权限管理系统的架构设计、功能特性以及实施部署的关键步骤。 一、系统概述 renren-fast与renren-security是两...
这可能是一个仿人人网(RenRen)的滑动布局,它可能实现了侧滑菜单和主内容视图的交互。在图片加载方面,这种布局可能涉及如何在滑动时高效地加载和显示图片,以防止内存泄漏和性能问题。 6. **myGallery.zip**: ...
《renren-security轻量级权限管理系统3.2最新完整版开发文档详解》 在软件开发领域,权限管理是系统安全的重要组成部分,它涉及到用户角色、权限分配、访问控制等多个方面。`renren-security`是一个专注于权限管理...
renren-security (人人权限系统)是一套轻量级的权限系统,主要包括用户管理、角色管理、部门管理、菜单管 理、定时任务、参数管理、字典管理、文件上传、系统日志、文章管理、APP模块等功能。其 中,还拥有多数据源...
《renren-security开发文档3.2_完整版》是一个针对Java开发者的安全框架的详细指南。这个压缩包包含了“renren-security开发文档3.2_完整版.pdf”这份文件,旨在提供全面的renren-security框架的使用和配置指导。...
《renrenio-renren-generator-master:简易后台代码生成器详解》 在软件开发过程中,代码生成器是一个极其重要的工具,它能显著提高开发效率,减少重复劳动。"renrenio-renren-generator-master"就是这样一个专注于...