首页 文章 精选 留言 我的

精选列表

搜索[桌面应用开发],共10000篇文章
优秀的个人博客,低调大师

Android开发学习:在Eclipse中导入Android项目方法

在Eclipse中导入Android项目方法的具体步骤如下: 1.启动Eclipse,依次选择File---Import,如下图所示: 2.在弹出的Import窗口中选择Existing Projects into Workspace,然后单击Next按钮,如下图所示: 3.在弹出的Import窗口选择Browse按钮,选择要导入项目的位置,如下图所示: 4.单击Finish按钮后,完成整个导入过程,在eclipse中讲显示这个导入的实例,如下如所示 5.需要运行这个项目,依次选择Run---Run Configurations 6.在弹出的窗口中设置标志名,再选择Browse文件功能和项目位置 7.单击Run后开始运行这个项目 本文转自 lingdududu 51CTO博客,原文链接:http://blog.51cto.com/liangruijun/667705

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

Android UI开发第十七篇——Android Fragment实例

TitlesFragment TitlesFragment继承自Fragment的子类ListFragment,使用了一个静态数组填充列表,重写了onListItemClick方法,showDetails方法展示ListView item的详情。 DetailsFragment df = DetailsFragment.newInstance(index);//获取详情Fragment的实例 FragmentTransaction ft = getFragmentManager().beginTransaction();//获取FragmentTransaction 实例 ft.replace(R.id.details, df); //使用DetailsFragment 的实例 ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); ft.commit();//提交 这里就使用到了Android Fragment使用中介绍的第二种加载fragment的方法。看一下DetailsFragment : 布局文件中使用了fragment标签和FrameLayout标签。Android Fragment使用中介绍了2中嵌入Fragment的方法,这个实例中都用到,从布局文件看到有了fragment标签,这是一种使用方法,FrameLayout标签将会成为第二种加载fragment的载体view。 看一下程序实现(com.fragment.main.TitlesFragment): 效果图的左边是一个列表,右边是列表item的详情。 先看一下布局文件(layout): Fragment是Android honeycomb 3.0新增的概念,在Android——Fragment介绍、Android Fragment使用、Android FragmentManage FragmentTransaction介绍中做了关于Fragment的详细介绍。这一片主要通过一个实例了解Fragment的使用。 先看下实例效果图: 本文转自xyz_lmn51CTO博客,原文链接:http://blog.51cto.com/xyzlmn/817249,如需转载请自行联系原作者

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

Android UI开发第九篇——SlidingDrawer 抽屉效果

SlidingDrawer是自SDK 1.5才新加入的,实现Launcher的抽屉效果。SlidingDrawer配置上采用了水平展开或垂直展开两种(android:orientation)方式,在XML里必须指定其使用的android:handle与android:content,前者委托要展开的图片(Layout配置),后者则是要展开的Layout Content。 <?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/i1" > <SlidingDrawer android:id="@+id/slidingdrawer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:handle="@+id/handle" android:content="@+id/content"> <Button android:id="@+id/handle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/ic_dialog_dialer" /> <LinearLayout android:id="@+id/content" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/default_bg"> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <EditText android:id="@+id/editText" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout> </SlidingDrawer> </LinearLayout> 补充: 一、简介 SlidingDrawer隐藏屏外的内容,并允许用户通过handle以显示隐藏内容。它可以垂直或水平滑动,它有俩个View组成,其一是可以拖动的handle,其二是隐藏内容的View.它里面的控件必须设置布局,在布局文件中必须指定handle和content. 例如下面 <SlidingDrawer android:layout_width="fill_parent" android:layout_height="fill_parent" android:handle="@+id/handle" android:content="@+id/content" android:orientation="vertical" android:id="@+id/slidingdrawer"> <ImageButton android:id="@id/handle" android:layout_width="50dip" android:layout_height="44dip" android:src="@drawable/up" /> <LinearLayout android:id="@id/content" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ffffff"> <TextView android:text="这是一个滑动式抽屉的示例" android:id="@+id/tv" android:textSize="18px" android:textColor="#000000" android:gravity="center_vertical|center_horizontal" android:layout_width="match_parent" android:textStyle="bold" android:layout_height="match_parent"></TextView> </LinearLayout> </SlidingDrawer> 二、重要属性 android:allowSingleTap:指示是否可以通过handle打开或关闭 android:animateOnClick:指示是否当使用者按下手柄打开/关闭时是否该有一个动画。 android:content:隐藏的内容 android:handle:handle(手柄) 三、重要方法 animateClose():关闭时实现动画。 close():即时关闭 getContent():获取内容 isMoving():指示SlidingDrawer是否在移动。 isOpened():指示SlidingDrawer是否已全部打开 lock():屏蔽触摸事件。 setOnDrawerCloseListener(SlidingDrawer.OnDrawerCloseListener onDrawerCloseListener):SlidingDrawer关闭时调用 unlock():解除屏蔽触摸事件。 toggle():切换打开和关闭的抽屉SlidingDrawer。 四、完整实例 1.布局文件slidingdrawer.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="@drawable/default_bg"> <SlidingDrawer android:layout_width="fill_parent" android:layout_height="fill_parent" android:handle="@+id/handle" android:content="@+id/content" android:orientation="vertical" android:id="@+id/slidingdrawer"> <ImageButton android:id="@id/handle" android:layout_width="50dip" android:layout_height="44dip" android:src="@drawable/up" /> <LinearLayout android:id="@id/content" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ffffff"> <TextView android:text="这是一个滑动式抽屉的示例" android:id="@+id/tv" android:textSize="18px" android:textColor="#000000" android:gravity="center_vertical|center_horizontal" android:layout_width="match_parent" android:textStyle="bold" android:layout_height="match_parent"></TextView> </LinearLayout> </SlidingDrawer> </LinearLayout> 2.Java代码 package com.wjq; import android.app.Activity; import android.os.Bundle; import android.widget.ImageButton; import android.widget.SlidingDrawer; import android.widget.TextView; public class SlidingDrawerDemo extends Activity { private SlidingDrawer mDrawer; private ImageButton imbg; private Boolean flag=false; private TextView tv; /* (non-Javadoc) * @see android.app.Activity#onCreate(android.os.Bundle) */ @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.sildingdrawer); imbg=(ImageButton)findViewById(R.id.handle); mDrawer=(SlidingDrawer)findViewById(R.id.slidingdrawer); tv=(TextView)findViewById(R.id.tv); mDrawer.setOnDrawerOpenListener(new SlidingDrawer.OnDrawerOpenListener() { @Override public void onDrawerOpened() { flag=true; imbg.setImageResource(R.drawable.down); } }); mDrawer.setOnDrawerCloseListener(new SlidingDrawer.OnDrawerCloseListener(){ @Override public void onDrawerClosed() { flag=false; imbg.setImageResource(R.drawable.up); } }); mDrawer.setOnDrawerScrollListener(new SlidingDrawer.OnDrawerScrollListener(){ @Override public void onScrollEnded() { tv.setText("结束拖动"); } @Override public void onScrollStarted() { tv.setText("开始拖动"); } }); } } 本文转自xyz_lmn51CTO博客,原文链接:http://blog.51cto.com/xyzlmn/817346,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

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

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

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

用户登录
用户注册