android studio怎么使用 popupwindow的使用

欢迎光临!
自定义overflow菜单的实现(PopupWindow)
自定义overflow菜单的实现(PopupWindow)
编辑日期: 字体:
当Action Bar的Action放不下时,系统会将其收集在overflow中。
用hierarchyviewer查看系统自己生成的Overflow,发现它本身就是popupWindow。
所以我们也可以用popUpWindow来写自己的overflow实现更多功能,做出像微信一样的效果。
最右边的Action(那个三点菜单)是自己添加的Action,使用了android开发包里的图标ic_action_overflow.png,可到官网下载。
首先在Item中添加Action,为了演示,添加了一个Submenu
&menu xmlns:android="/apk/res/android"
xmlns:app="/apk/res-auto"
xmlns:tools="/tools"
tools:context="com.example.popupwindowoverflow.MainActivity" &
android:id="@+id/action_new"
android:orderInCategory="1"
android:title="SubMenu"
android:icon="@drawable/ic_action_new"
app:showAsAction="always"&
&item android:id="@+id/submenu1"
android:title="Accept"
android:titleCondensed="Accept"
android:icon="@drawable/ic_action_accept" /&
&item android:id="@+id/submenu2"
android:title="Cancel"
android:titleCondensed="Cancel"
android:icon="@drawable/ic_action_cancel" /&
&item android:id="@+id/submenu3"
android:title="Unread"
android:titleCondensed="Unread"
android:icon="@drawable/ic_action_unread" /&
android:id="@+id/action_overflow"
android:orderInCategory="2"
android:title="PopupWindow"
android:icon="@drawable/ic_action_overflow"
app:showAsAction="always"/&
123456789101112131415161718192021222324252627282930313233
&menu xmlns:android="/apk/res/android"&&&&xmlns:app="/apk/res-auto"&&&&xmlns:tools="/tools"&&&&tools:context="com.example.popupwindowoverflow.MainActivity" &&item&&&&&&&&android:id="@+id/action_new"&&&&&&&&android:orderInCategory="1"&&&&&&&&android:title="SubMenu"&&&&&&&&android:icon="@drawable/ic_action_new"&&&&&&&&app:showAsAction="always"&&&&&&menu&&&&&&&&&&item android:id="@+id/submenu1" &&&&&&&&&&&&android:title="Accept" &&&&&&&&&&&&android:titleCondensed="Accept"&&&&&&&&&&&&android:icon="@drawable/ic_action_accept" /&&&&&&&&& &item android:id="@+id/submenu2" &&&&&&&&&&&&android:title="Cancel" &&&&&&&&&&&&android:titleCondensed="Cancel"&&&&&&&&&&&&android:icon="@drawable/ic_action_cancel" /&&&&&&&&& &item android:id="@+id/submenu3" &&&&&&&&&&&&android:title="Unread" &&&&&&&&&&&&android:titleCondensed="Unread"&&&&&&&&&&&&android:icon="@drawable/ic_action_unread" /&&&&&&/menu&&/item&&item&&&&&&&&android:id="@+id/action_overflow"&&&&&&&&android:orderInCategory="2"&&&&&&&&android:title="PopupWindow"&&&&&&&&android:icon="@drawable/ic_action_overflow"&&&&&&&&app:showAsAction="always"/&&&/menu&
监听ID为action_overflow的Action,创建popupWindow弹出自己的overflow。
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
switch (id) {
case R.id.action_overflow:
popUpMyOverflow();//弹出自定义overflow
return super.onOptionsItemSelected(item);
123456789101112
public boolean onOptionsItemSelected(MenuItem item) {&&&&&&&&// Handle action bar item clicks here. The action bar will&&&&&&&&// automatically handle clicks on the Home/Up button, so long&&&&&&&&// as you specify a parent activity in AndroidManifest.xml.&&&&&& &&&&&&&&int id = item.getItemId();&&&&&&&&switch (id) {&&&&&&&&case R.id.action_overflow:&&&&&&&&&&&&popUpMyOverflow();//弹出自定义overflow&&&&&&&&&&&&return true;&&&&&&&&}&&&&&&&&return super.onOptionsItemSelected(item);&&&&}
下面介绍popUpMyOverflow()方法,就是通过它弹出了我们的overflow,自定义overflow的布局文件就是R.layout.action_overflow_popwindow,这里就不贴出来啦。
public void popUpMyOverflow() {
* 定位PopupWindow,让它恰好显示在Action Bar的下方。 通过设置Gravity,确定PopupWindow的大致位置。
* 首先获得状态栏的高度,再获取Action bar的高度,这两者相加设置y方向的offset样PopupWindow就显示在action
* bar的下方了。 通过dp计算出px,就可以在不同密度屏幕统一X方向的offset.但是要注意不要让背景阴影大于所设置的offset,
* 否则阴影的宽度为offset.
// 获取状态栏高度
Rect frame = new Rect();
getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);
状态栏高度:frame.top
int xOffset = frame.top+getActionBar().getHeight()-25;//减去阴影宽度,适配UI.
int yOffset = Dp2Px(this, 5f); //设置x方向offset为5dp
View parentView = getLayoutInflater().inflate(R.layout.activity_main,
View popView = getLayoutInflater().inflate(
R.layout.action_overflow_popwindow, null);
PopupWindow popWind = new PopupWindow(popView,
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true);//popView即popupWindow的布局,ture设置focusAble.
//必须设置BackgroundDrawable后setOutsideTouchable(true)才会有效。这里在XML中定义背景,所以这里设置为
popWind.setBackgroundDrawable(new BitmapDrawable(getResources(),
(Bitmap) null));
popWind.setOutsideTouchable(true); //点击外部关闭。
popWind.setAnimationStyle(android.R.style.Animation_Dialog);
//设置一个动画。
//设置Gravity,让它显示在右上角。
popWind.showAtLocation(parentView, Gravity.RIGHT | Gravity.TOP,
yOffset, xOffset);
1234567891011121314151617181920212223242526272829
public void popUpMyOverflow() {&&&&&&&&/**&&&&&&&& * 定位PopupWindow,让它恰好显示在Action Bar的下方。 通过设置Gravity,确定PopupWindow的大致位置。&&&&&&&& * 首先获得状态栏的高度,再获取Action bar的高度,这两者相加设置y方向的offset样PopupWindow就显示在action&&&&&&&& * bar的下方了。 通过dp计算出px,就可以在不同密度屏幕统一X方向的offset.但是要注意不要让背景阴影大于所设置的offset,&&&&&&&& * 否则阴影的宽度为offset.&&&&&&&& */&&&&&&&&// 获取状态栏高度&&&&&&&&Rect frame = new Rect();&&&&&&&&getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);//&&&&&&&&状态栏高度:frame.top&&&&&&&&int xOffset = frame.top+getActionBar().getHeight()-25;//减去阴影宽度,适配UI.&&&&&&&&int yOffset = Dp2Px(this, 5f); //设置x方向offset为5dp&&&&&&&&View parentView = getLayoutInflater().inflate(R.layout.activity_main,&&&&&&&&&&&&&&&&null);&&&&&&&&View popView = getLayoutInflater().inflate(&&&&&&&&&&&&&&&&R.layout.action_overflow_popwindow, null);&&&&&&&&PopupWindow popWind = new PopupWindow(popView,&&&&&&&&&&&&&&&&LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true);//popView即popupWindow的布局,ture设置focusAble.&&&&&&&&&&&&&&&&//必须设置BackgroundDrawable后setOutsideTouchable(true)才会有效。这里在XML中定义背景,所以这里设置为&&&&&&&&popWind.setBackgroundDrawable(new BitmapDrawable(getResources(),&&&&&&&&&&&&&&&&(Bitmap) null));&&&&&&&&popWind.setOutsideTouchable(true); //点击外部关闭。&&&&&&&&popWind.setAnimationStyle(android.R.style.Animation_Dialog);&&&&//设置一个动画。&&&&&&&&//设置Gravity,让它显示在右上角。&&&&&&&&popWind.showAtLocation(parentView, Gravity.RIGHT | Gravity.TOP,&&&&&&&&&&&&&&&&yOffset, xOffset);&&&&}
在android中,为了适配不同屏幕密度和尺寸,android用了Dp单位,但是在Java代码中多是接受px单位的尺寸,所以这里要转换一下。
Dp转换Px的方法。
public int Dp2Px(Context context, float dp) {
final float scale = context.getResources().getDisplayMetrics().
return (int) (dp * scale + 0.5f);
public int Dp2Px(Context context, float dp) {&&&&final float scale = context.getResources().getDisplayMetrics().density;&&&&return (int) (dp * scale + 0.5f);}
本文固定链接:
转载请注明:
作者:leehom
本博客主要是把自己的经验记录于此,方便自己以后查阅及其他遇到类似问题的朋友参考。如果你有觉得不错的文章,可以注册会员发布文章或者邮箱发给我文章地址,谢谢!
如果觉得文章还不错,请麻烦点下广告,算是赞助下本站服务器费用,谢谢!
您可能还会对这些文章感兴趣!PopupWindow在android中的使用分析 - 推酷
PopupWindow在android中的使用分析
PopupWindow
中的使用分析
PopupWindow
是应用开发中经常用到的组建,使用它可以在当前屏幕的上层显示一个弹窗,同时也可以指定弹窗的位置以及背景色等特性,大大提高用户体验,那么这里我就以下几点介绍它的使用:
从指定的位置弹出这个窗口(淡入淡出动画)
从屏幕底部弹出这个窗口(带有透明度背景,自定义触摸其他位置自动关闭弹窗)
我的效果图如下:
下面直接上代码,具体如下所示(按开发顺序排列)
自定义一个继承自
PopupWindow
PopupDialog
PopupWindow {
PopupDialog(View view ,
height ) {
( view , width , height );
自定义一个负责设定
PopupWindow
特性的属性类
弹出窗口的
弹出窗口的
vWidth ; //
窗口显示内容的视图宽度
vHeight ; //
窗口显示内容的视图高度
animFadeInOut ; //
窗口显示动画
contentView ; //
潜入在窗口的视图
View customView ; //
潜入的窗口视图
isClickable ; //
视图外部是否可以点击
OnDismissListener listener ; //
监听弹窗是否
OnTouchListener touchListener ; //
监听触摸位置
bgAlpha ; //
背景遮罩的透明度
getxPos() {
. xPos = xPos ;
getyPos() {
. yPos = ypos ;
getvWidth() {
setvWidth(
vWidth ) {
. vWidth = vWidth ;
getvHeight() {
setvHeight(
vHeight ) {
. vHeight = vHeight ;
getAnimFadeInOut() {
animFadeInOut ;
setAnimFadeInOut(
animFadeInOut ){
. animFadeInOut = animFadeInOut ;
getContentView() {
contentView ;
setContentView(
contentView ){
. contentView = contentView ;
isClickable() {
isClickable ;
setClickable(
isClickable ){
. isClickable = isClickable ;
View getCustomView() {
customView ;
setCustomView(View customView ){
. customView = customView ;
OnDismissListener getListener() {
listener ;
setListener(OnDismissListener listener ){
. listener = listener ;
getBgAlpha() {
setBgAlpha(
bgAlpha ) {
. bgAlpha = bgAlpha ;
OnTouchListener getTouchListener() {
touchListener ;
setTouchListener(OnTouchListener touchListener ){
. touchListener = touchListener ;
自定义一个用来管理
PopupWindow
PopupUtils {
PopupDialog
popupDialog
@SuppressLint ( &NewApi& )
PopupDialog createPopupDialog(Context context ,Popup dialog ) {
dismissPopupDialog ();
View view =
(ValueUtils.
( dialog .getCustomView())){
LayoutInflater inflater =LayoutInflater.
( context );
view = inflater .inflate( dialog .getContentView(),
view = dialog .getCustomView();
view .setOnTouchListener( dialog .getTouchListener());
(0!= dialog .getBgAlpha()){
view .setAlpha( dialog .getBgAlpha());
popupDialog
PopupDialog( view , dialog .getvWidth(), dialog .getvHeight());
ColorDrawable dw =
ColorDrawable(Color.
TRANSPARENT
); //follow two lines is used for back key -00000
popupDialog
.setBackgroundDrawable( dw );
popupDialog
.setAnimationStyle( dialog .getAnimFadeInOut());
popupDialog
.setOutsideTouchable( dialog .isClickable());
popupDialog
.setFocusable(
); //not allow user click
popupwindow
background event or not permit
popupDialog
.setOnDismissListener( dialog .getListener());
popupDialog
.update();
popupDialog
dismissPopupDialog() {
(ValueUtils.
isNotEmpty
popupDialog
popupDialog
.isShowing()){
popupDialog
.dismiss();
popupDialog
isPopupShowing() {
(ValueUtils.
isNotEmpty
popupDialog
popupDialog
.isShowing()){
接下来,我们需要准备相关的资源文件了,比如:导航按钮页面,采购清单弹窗页面以,选择美图窗口页面以及需要用到的动画文件和圆角背景文件,具体如下:
导航按钮页面
& ScrollView xmlns:android =
&/apk/res/android&
android:layout_width =
&match_parent&
android:layout_height =
&match_parent&
android:id =
&@+id/main&
android:background =
& LinearLayout
android:layout_width =
&match_parent&
android:layout_height =
&wrap_content&
android:orientation =
&vertical&
android:id =
&@+id/btnDropDownPopupDialog&
android:layout_width =
&match_parent&
android:layout_height =
android:layout_gravity =
&center_horizontal&
android:layout_marginLeft =
android:layout_marginRight =
android:layout_marginTop =
android:background =
android:textColor =
android:text
android:id =
&@+id/btnDownUpPopupDialog&
android:layout_width =
&match_parent&
android:layout_height =
android:layout_gravity =
&center_horizontal&
android:layout_marginLeft =
android:layout_marginRight =
android:layout_marginTop =
android:background =
android:textColor =
android:text
&/ LinearLayout &
ScrollView
采购清单弹窗页面
& RelativeLayout xmlns:android =
&/apk/res/android&
android:layout_width =
&wrap_content&
android:layout_height =
&wrap_content&
android:background =
android:gravity =
& TextView
android:id =
&@+id/tvbillTypeYc&
android:layout_width =
&match_parent&
android:layout_height =
&wrap_content&
android:text
android:textColor =
android:padding =
android:layout_margin =
android:gravity =
android:background =
&@drawable/corners_bk_gray2&
& TextView
android:id =
&@+id/tvbillTypeCc&
android:layout_width =
&match_parent&
android:layout_height =
&wrap_content&
android:text
android:textColor =
android:padding =
android:layout_margin =
android:gravity =
android:layout_below =
&@id/tvbillTypeYc&
android:background =
&@drawable/corners_bk_gray2&
& TextView
android:id =
&@+id/tvbillTypeXc&
android:layout_width =
&match_parent&
android:layout_height =
&wrap_content&
android:text
android:textColor =
android:padding =
android:layout_margin =
android:gravity =
android:layout_below =
&@id/tvbillTypeCc&
android:background =
&@drawable/corners_bk_gray2&
& TextView
android:id =
&@+id/tvbillTypeMore&
android:layout_width =
&match_parent&
android:layout_height =
&wrap_content&
android:text
android:textColor =
android:padding =
android:layout_margin =
android:gravity =
android:layout_below =
&@id/tvbillTypeXc&
android:background =
&@drawable/corners_bk_gray2&
RelativeLayout
选择美图弹窗页面
& RelativeLayout xmlns:android =
&/apk/res/android&
android:layout_width =
&match_parent&
android:layout_height =
&match_parent&
android:background =
& FrameLayout
android:id =
&@+id/flMaskLayer&
android:layout_width =
&match_parent&
android:layout_height =
&match_parent&
android:background =
& LinearLayout
android:id =
&@+id/llHeader&
android:layout_width =
&match_parent&
android:layout_height =
&wrap_content&
android:layout_marginLeft =
android:layout_marginRight =
android:orientation =
&vertical&
android:layout_alignParentBottom =
& RelativeLayout
android:layout_width =
&match_parent&
android:layout_height =
android:background =
&@drawable/corners_bk_white&
& TextView
android:id =
&@+id/tvTakeHeader&
android:layout_width =
&match_parent&
android:layout_height =
android:text
android:textColor =
android:gravity =
android:layout_width =
&match_parent&
android:layout_height =
android:background =
&@color/gray&
android:layout_centerVertical =
& TextView
android:id =
&@+id/tvHeaderFromSD&
android:layout_width =
&match_parent&
android:layout_height =
android:text
从相册中选
android:textColor =
android:gravity =
android:layout_below =
&@id/tvTakeHeader&
&/ RelativeLayout &
& TextView
android:id =
&@+id/tvCancel&
android:layout_width =
&match_parent&
android:layout_height =
android:text
android:textColor =
android:background =
&@drawable/corners_bk_white&
android:gravity =
android:layout_marginTop =
&/ LinearLayout &
RelativeLayout
淡入淡出动画文件
淡入动画:
&? xml version =
encoding =
standalone =
& set xmlns:android =
&/apk/res/android&
android:interpolator =
&@android:anim/decelerate_interpolator&
android:duration =
android:fromAlpha =
android:toAlpha =
淡出动画:
&? xml version =
encoding =
standalone =
& set xmlns:android =
&/apk/res/android&
android:interpolator =
&@android:anim/decelerate_interpolator&
android:duration =
android:fromAlpha =
android:toAlpha =
圆角背景文件
采购清单背景:
&? xml version =
encoding =
& shape xmlns:android =
&/apk/res/android&
& solid android:color =
android:radius =
android:bottom =
android:left =
android:right =
android:top =
android:width =
android:color =
底部弹窗:
&? xml version =
encoding =
& shape xmlns:android =
&/apk/res/android&
& solid android:color =
android:bottomLeftRadius =
android:bottomRightRadius =
android:topLeftRadius =
android:topRightRadius =
到这里,我们已经准备了所有需要的工作,接下来就是在我们的前段页面中调用即可。主要是通过参数对象包装参数,并调用上面的工具类进行展示和隐藏我们需要的
PopupWindow
即可,具体如下:
ViewUtilsActivity
FragmentActivity {
ViewUtilsFragment
onCreate(Bundle bundle ){
.onCreate( bundle );
requestWindowFeature(Window.
FEATURE_NO_TITLE
setContentView(R.layout.
activity_base_main
== bundle ){
FragmentTransaction ft =getSupportFragmentManager().beginTransaction();
ViewUtilsFragment();
ft .add(R.id.
ft .commit();
ViewUtilsFragment
implements
View.OnClickListener {
PopupDialog popupDialog =
Button btnDropDownPopupDialog =
Button btnDownUpPopupDialog =
View onCreateView(LayoutInflater inflater ,ViewGroup container ,
Bundle savedInstanceState ){
View rootView =(View) inflater .inflate(R.layout.
fragment_viewutils
, container ,
btnDropDownPopupDialog = (Button) rootView .findViewById(R.id.
btnDropDownPopupDialog
btnDropDownPopupDialog .setOnClickListener(
btnDownUpPopupDialog = (Button) rootView .findViewById(R.id.
btnDownUpPopupDialog
btnDownUpPopupDialog .setOnClickListener(
rootView ;
onClick(View v ){
( v .getId()){
btnDropDownPopupDialog
showDropDownPopupDialog();
btnDownUpPopupDialog
showDownUpPopupDialog();
showDropDownPopupDialog() {
Popup popup =
这里是获得屏幕宽度使弹窗水平居中
xPos =(AppUtils.
getScreenWidth
(getActivity())- btnDropDownPopupDialog .getWidth())/ 2;
popup .setxPos( xPos );
popup .setyPos(0);
popup .setvWidth(LayoutParams.
WRAP_CONTENT
popup .setvHeight(LayoutParams.
WRAP_CONTENT
popup .setClickable(
popup .setAnimFadeInOut(R.style.
AnimationFade
popup .setContentView(R.layout.
view_popup_dialog
popupDialog = ViewUtils.
createPopupDialog
(getActivity(), popup );
popupDialog .showAsDropDown( btnDropDownPopupDialog , popup .getxPos(), popup .getyPos());
@SuppressLint ({ &NewApi& , &ClickableViewAccessibility& })
showDownUpPopupDialog() {
Popup popup =
popup .setvWidth(LayoutParams.
MATCH_PARENT
popup .setvHeight(LayoutParams.
MATCH_PARENT
popup .setClickable(
popup .setContentView(R.layout.
view_userheader_modifydetail
设置触摸其他位置时关闭窗口
OnTouchListener listener =
OnTouchListener() {
onTouch(View view ,MotionEvent event ){
height = view .findViewById(R.id.
).getTop();
) event .getY();
( event .getAction()==MotionEvent.
( y & height ){
ViewUtils. dismissPopupDialog ();
popup .setTouchListener( listener );
popupDialog = ViewUtils.
createPopupDialog
(getActivity(), popup );
popupDialog .showAtLocation(getActivity().findViewById(R.id.
CENTER_HORIZONTAL
, popup .getxPos(), popup .getyPos());
View view = popupDialog .getContentView();
背景透明度设置
view .findViewById(R.id.
flMaskLayer
).setAlpha(0.75f);
View.OnClickListener l =
View.OnClickListener() {
onClick(View v ){
( v .getId()== R.id.
ViewUtils. dismissPopupDialog ();
( v .getId()== R.id.
tvTakeHeader
//take phone
(getActivity(), &
LENGTH_SHORT
ViewUtils. dismissPopupDialog ();
( v .getId()== R.id.
tvHeaderFromSD
//pick picture from
(getActivity(), &
从相册中选
LENGTH_SHORT
ViewUtils. dismissPopupDialog ();
view .findViewById(R.id.
).setOnClickListener( l );
view .findViewById(R.id.
tvTakeHeader
).setOnClickListener( l );
view .findViewById(R.id.
tvHeaderFromSD
).setOnClickListener( l );
PopupDialog getPopupDialog() {
popupDialog ;
监听返回按钮
onKeyDown(
keyCode ,KeyEvent event ){
( keyCode ){
KEYCODE_BACK
flag =ViewUtils.
isPopupShowing
ViewUtils. dismissPopupDialog ();
.onKeyDown( keyCode , event );
好了,到这里我们的工作就完成啦,可以欣赏自己的作品了。
如果有问题,可以在评论中或群
进行讨论,谢谢。
已发表评论数()
已收藏到推刊!
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
标题不准确
排版有问题
没有分页内容
图片无法显示
视频无法显示
与原文不一致Android Studio使用心得 - 简介与环境配置
关于Android Studio
在2013 Google IO大会上发布的全新IDE Android Studio相信各位猿们并不陌生,截止2014的Google IO大会,虽然依然木有发布正式版,但是根据我这几周的使用情况来说,BUG已经很少了,完全不影响正常使用。而且Android Studio是基于IntelliJ的,无论从运行速度上还是的快捷性上,都比Eclipse的体验要好,开发效率妥妥的提高了。
Android Studio vs Eclipse ADT
目前Android Studio最大的缺点是还不支持NDK,如果项目里面有使用NDK的,估计要正式版后才能用了。
vcD4KPHA+PC9wPgo8aDE+Cgo8c3Ryb25nPrnY09qw5rG+o7o8L3N0cm9uZz4KPC9oMT4KPHA+PC9wPgo8cD692NbBMjAxNC8wOC8xM6OsxL/HsNfu0MKw5srHPHN0cm9uZz5DYW5hcnk8L3N0cm9uZz4gQ2hhbm5lbLXEMC44LjY8L3A+CjxwPqOosrmz5Mu1w/fSu8/C1eLA77XEsOaxvqO619y5srfWzqo0uPZDaGFubmVso6y31rHwysejukNhbmFyeaOsRGV2o6xCZXRho6xTdGFibGWho8bkuPzQwsa1wsrW8L2ltd289aOsQ2FuYXJ5tPO4xTG78tXfMtbcu+G4/NDC0ru0zqOsQmV0YdTyzqrP4LbUzsi2qLXEt6KyvLDmo6y2+FN0YWJsZdTyyse0q8u11tC1xNX9yr2w5qOsxL/HsLu5xL7T0KGjo6k8L3A+CjxwPs341rejujwvcD4KPHA+PC9wPgotIGh0dHA6Ly90b29scy5hbmRyb2lkLmNvbS9kb3dubG9hZC9zdHVkaW8gIKOox73B0c3GvPa007TLz8LU2Nfu0MKw5qOsPHN0cm9uZz7A7dPJ0rujusLMyauw5qOswO3Tybb+o7rE3LywyrG78cih1+7QwrDmPC9zdHJvbmc+o6jNxrz208NDYW5hcnkgsOajqaOpPGJyPgotIGh0dHA6Ly9kZXZlbG9wZXIuYW5kcm9pZC5jb20vc2RrL2luc3RhbGxpbmcvc3R1ZGlvLmh0bWwgo6i1sci7xOPSsr/J0tS007nZzfjPwtTYo6zKx9K7uPawstewzsS8/qOs0+vJz8PmsrvNrLXEysfL+7D8uqzBy9K7uPZBbmRyb2lkIEwgUHJldmlld7XEU0RLo6zG5Mq1ztLDx7Tzv8nS1NPD19S8urG+u/q1xFNES6OpPGJyPgotIGh0dHBzOi8vZ2l0aHViLmNvbS9pbmZlcmpheS9BbmRyb2lkRGV2VG9vbHMvIKOosru74betx721xNSzw8e/ydLUtNPV4sDvz8LU2KOswO/D5rD8uqy63Lbgv6q3ormkvt/XytS0o6y4/NDCy9m2yLHIudm3vcnUwv2jqQo8cD48L3A+CjxwPjxicj4KPC9wPgo8cD48YnI+CjwvcD4KPHA+PC9wPgo8aDE+Cgq/qsq8xeTWw7u3vrMKPC9oMT4KPHA+PC9wPgo8cD63z7uwsru24Mu1wcujrMbkyrW63Mjd0te1xKOs0tTPwry4sr3Q6NKq16LS4rXEo7o8L3A+CjxwPjGhorTTRWNsaXBzZTxzdHJvbmc+tbyz9mJ1aWxkLmdyYWRsZTwvc3Ryb25nPs7EvP6jukV4cG9ydC0+QW5kcm9pZC0+R2VuZXJhdGUgR3JhZGxlIGJ1aWxkIGZpbGVzo6zRodbQ0OjSqrW8s/a1xM/uxL+hozwvcD4KPHA+o6jXotLio7rI57n709DSwMC1TGlicmFyeb/iz+7Ev7XEo6y74dfUtq+w78Tjyrax8LKi0aHJz6Os0rvG8LW8s/a+zdDQwcuho8jnufvT0Hdhcm5pbmejrLHtw/e4w8S/wrzWrsewtObU2mJ1aWxkLmdyYWRsZc7EvP6jrDwvcD4KPHA+ubTJz0ZvcmNlIG92ZXJyaWRpbmcgb2YgZXhpc3RpbmcgZmlsZby0v8m4srjHo6k8L3A+CjxwPjxpbWcgc3JjPQ=="/uploadfile/Collfiles/1.jpg" alt="\">
2、解压绿色版的.zip文件运行bin目录下的studio.exe(32位)或studio64.exe(64位),首先设置SDK和JDK路径,
在Quick Start界面Configure->Project Defaults->Project Structure
3、然后回到Quick Start界面选择Import Project选择步骤1中的build.gradle文件导入。第一次导入的时候会下载Gradle文件,大概50M,
时间比较长,要耐心等待哦,顺利的话就成功的从Eclipse导入到Android Studio了。
4、关于目录结构,若从Eclipse中生成build.gradle文件导入的,则会保留之前目录结构;若直接在Android
Studio中New Project生成的,则目录结构会比较奇怪,是Studio的标准目录结构(注意:Android Studio中的Project相当于Eclipse中的Workspace,
Module则相当于Eclipse中的Project,下图是一个Project,包括了几个Module)
Android Studio是趋势,正式版出了后很快会普及的。现在体验一把也无妨嘛,哈哈!!!
(window.slotbydup=window.slotbydup || []).push({
id: '2467140',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467141',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467143',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467148',
container: s,
size: '1000,90',
display: 'inlay-fix'

我要回帖

更多关于 popupwindow的使用 的文章

 

随机推荐