android 点击侧滑代码,代码分析Android实现侧滑菜单

Android 侧滑菜单的实现,参考网上的代码,实现侧滑菜单。最重要的是这个动画类UgcAnimations,如何使用动画类来侧滑的封装FlipperLayout。

1、实现效果

06a9a70cdb8cc98d415c6e748e6e9752.gif

2、动画类UgcAnimations

package com.mmsx.base;

import android.content.Context;

import android.view.View;

import android.view.ViewGroup.MarginLayoutParams;

import android.view.animation.AlphaAnimation;

import android.view.animation.Animation;

import android.view.animation.AnimationSet;

import android.view.animation.AnticipateInterpolator;

import android.view.animation.OvershootInterpolator;

import android.view.animation.RotateAnimation;

import android.view.animation.ScaleAnimation;

import android.view.animation.TranslateAnimation;

import android.widget.ImageView;

import android.widget.RelativeLayout;

/**

* Path动画类

*

*/

public class UgcAnimations {

private static int xOffset = 15;

private static int yOffset = -13;

public static void initOffset(Context context) {

xOffset = (int) (15 * context.getResources().getDisplayMetrics().density);

yOffset = -(int) (13 * context.getResources().getDisplayMetrics().density);

}

public static Animation getRotateAnimation(float fromDegrees,

float toDegrees, long durationMillis) {

RotateAnimation rotate = new RotateAnimation(fromDegrees, toDegrees,

Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,

0.5f);

rotate.setDuration(durationMillis);

rotate.setFillAfter(true);

return rotate;

}

public static Animation getAlphaAnimation(float fromAlpha, float toAlpha,

long durationMillis) {

AlphaAnimation alpha = new AlphaAnimation(fromAlpha, toAlpha);

alpha.setDuration(durationMillis);

alpha.setFillAfter(true);

return alpha;

}

public static Animation getScaleAnimation(long durationMillis) {

ScaleAnimation scale = new ScaleAnimation(1.0f, 1.5f, 1.0f, 1.5f,

Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,

0.5f);

scale.setDuration(durationMillis);

return scale;

}

public static Animation getTranslateAnimation(float fromXDelta,

float toXDelta, float fromYDelta, float toYDelta,

long durationMillis) {

TranslateAnimation translate = new TranslateAnimation(fromXDelta,

toXDelta, fromYDelta, toYDelta);

translate.setDuration(durationMillis);

translate.setFillAfter(true);

return translate;

}

public static void startOpenAnimation(RelativeLayout relativeLayout,

ImageView background, ImageView menu, long durationMillis) {

background.setVisibility(View.VISIBLE);

relativeLayout.setVisibility(View.VISIBLE);

background.startAnimation(getAlphaAnimation(0f, 1f, durationMillis));

menu.startAnimation(getRotateAnimation(0, 90, durationMillis));

for (int i = 0; i < relativeLayout.getChildCount(); i++) {

ImageView imageView = (ImageView) relativeLayout.getChildAt(i);

imageView.setVisibility(View.VISIBLE);

MarginLayoutParams params = (MarginLayoutParams) imageView

.getLayoutParams();

AnimationSet set = new AnimationSet(true);

set.addAnimation(getRotateAnimation(-270, 0, durationMillis));

set.addAnimation(getAlphaAnimation(0.5f, 1.0f, durationMillis));

set.addAnimation(getTranslateAnimation(

-params.leftMargin + xOffset, 0f, params.bottomMargin

+ yOffset, 0f, durationMillis));

set.setFillAfter(true);

set.setDuration(durationMillis);

set.setStartOffset((i * 100)

/ (-1 + relativeLayout.getChildCount()));

set.setInterpolator(new OvershootInterpolator(1f));

imageView.startAnimation(set);

}

}

public static void startCloseAnimation(final RelativeLayout relativeLayout,

final ImageView background, ImageView menu, long durationMillis) {

background.startAnimation(getAlphaAnimation(1f, 0f, durationMillis));

menu.startAnimation(getRotateAnimation(90, 0, durationMillis));

for (int i = 0; i < relativeLayout.getChildCount(); i++) {

final ImageView imageView = (ImageView) relativeLayout

.getChildAt(i);

MarginLayoutParams params = (MarginLayoutParams) imageView

.getLayoutParams();

AnimationSet set = new AnimationSet(true);

set.addAnimation(getRotateAnimation(0, -270, durationMillis));

set.addAnimation(getAlphaAnimation(1.0f, 0.5f, durationMillis));

set.addAnimation(getTranslateAnimation(0f, -params.leftMargin

+ xOffset, 0f, params.bottomMargin + yOffset,

durationMillis));

set.setFillAfter(true);

set.setDuration(durationMillis);

set.setStartOffset(((relativeLayout.getChildCount() - i) * 100)

/ (-1 + relativeLayout.getChildCount()));

set.setInterpolator(new AnticipateInterpolator(1f));

set.setAnimationListener(new Animation.AnimationListener() {

public void onAnimationStart(Animation arg0) {

}

public void onAnimationRepeat(Animation arg0) {

}

public void onAnimationEnd(Animation arg0) {

relativeLayout.setVisibility(View.GONE);

background.setVisibility(View.GONE);

}

});

imageView.startAnimation(set);

}

}

public static Animation clickAnimation(long durationMillis) {

AnimationSet set = new AnimationSet(true);

set.addAnimation(getAlphaAnimation(1.0f, 0.3f, durationMillis));

set.addAnimation(getScaleAnimation(durationMillis));

set.setDuration(durationMillis);

return set;

}

}

3、封装使用动画类FlipperLayout

package com.mmsx.base;

import android.content.Context;

import android.util.AttributeSet;

import android.util.TypedValue;

import android.view.MotionEvent;

import android.view.VelocityTracker;

import android.view.View;

import android.view.ViewConfiguration;

import android.view.ViewGroup;

import android.widget.Scroller;

/**

* 自己重写的ViewGroup,用与滑动切换界面使用,代码不详解,慢点看的话应该能看懂的...

*/

public class FlipperLayout extends ViewGroup {

private Scroller mScroller;

private VelocityTracker mVelocityTracker;

private int mWidth;

public static final int SCREEN_STATE_CLOSE = 0;

public static final int SCREEN_STATE_OPEN = 1;

public static final int TOUCH_STATE_RESTART = 0;

public static final int TOUCH_STATE_SCROLLING = 1;

public static final int SCROLL_STATE_NO_ALLOW = 0;

public static final int SCROLL_STATE_ALLOW = 1;

private int mScreenState = 0;

private int mTouchState = 0;

private int mScrollState = 0;

private int mVelocityValue = 0;

private boolean mOnClick = false;

private onUgcDismissListener mOnUgcDismissListener;

private onUgcShowListener mOnUgcShowListener;

public FlipperLayout(Context context) {

super(context);

mScroller = new Scroller(context);

mWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,

54, getResources().getDisplayMetrics());

}

public FlipperLayout(Context context, AttributeSet attrs, int defStyle) {

super(context, attrs, defStyle);

}

public FlipperLayout(Context context, AttributeSet attrs) {

super(context, attrs);

}

protected void onLayout(boolean changed, int l, int t, int r, int b) {

for (int i = 0; i < getChildCount(); i++) {

View child = getChildAt(i);

int height = child.getMeasuredHeight();

int width = child.getMeasuredWidth();

child.layout(0, 0, width, height);

}

}

protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

super.onMeasure(widthMeasureSpec, heightMeasureSpec);

int width = MeasureSpec.getSize(widthMeasureSpec);

int height = MeasureSpec.getSize(heightMeasureSpec);

setMeasuredDimension(width, height);

for (int i = 0; i < getChildCount(); i++) {

getChildAt(i).measure(widthMeasureSpec, heightMeasureSpec);

}

}

public boolean dispatchTouchEvent(MotionEvent ev) {

obtainVelocityTracker(ev);

switch (ev.getAction()) {

case MotionEvent.ACTION_DOWN:

mTouchState = mScroller.isFinished() ? TOUCH_STATE_RESTART

: TOUCH_STATE_SCROLLING;

if (mTouchState == TOUCH_STATE_RESTART) {

int x = (int) ev.getX();

int screenWidth = getWidth();

if (x <= mWidth && mScreenState == SCREEN_STATE_CLOSE

&& mTouchState == TOUCH_STATE_RESTART

|| x >= screenWidth - mWidth

&& mScreenState == SCREEN_STATE_OPEN

&& mTouchState == TOUCH_STATE_RESTART) {

if (mScreenState == SCREEN_STATE_OPEN) {

mOnClick = true;

}

mScrollState = SCROLL_STATE_ALLOW;

} else {

mOnClick = false;

mScrollState = SCROLL_STATE_NO_ALLOW;

}

} else {

return false;

}

break;

case MotionEvent.ACTION_MOVE:

mVelocityTracker.computeCurrentVelocity(1000,

ViewConfiguration.getMaximumFlingVelocity());

if (mScrollState == SCROLL_STATE_ALLOW

&& getWidth() - (int) ev.getX() < mWidth) {

return true;

}

break;

case MotionEvent.ACTION_UP:

releaseVelocityTracker();

if (mOnClick) {

mOnClick = false;

mScreenState = SCREEN_STATE_CLOSE;

mScroller.startScroll(getChildAt(1).getScrollX(), 0,

-getChildAt(1).getScrollX(), 0, 800);

invalidate();

}

break;

}

return super.dispatchTouchEvent(ev);

}

public boolean onInterceptTouchEvent(MotionEvent ev) {

obtainVelocityTracker(ev);

switch (ev.getAction()) {

case MotionEvent.ACTION_DOWN:

mTouchState = mScroller.isFinished() ? TOUCH_STATE_RESTART

: TOUCH_STATE_SCROLLING;

if (mTouchState == TOUCH_STATE_SCROLLING) {

return false;

}

break;

case MotionEvent.ACTION_MOVE:

mOnClick = false;

mVelocityTracker.computeCurrentVelocity(1000,

ViewConfiguration.getMaximumFlingVelocity());

if (mScrollState == SCROLL_STATE_ALLOW

&& Math.abs(mVelocityTracker.getXVelocity()) > 200) {

return true;

}

break;

case MotionEvent.ACTION_UP:

releaseVelocityTracker();

if (mScrollState == SCROLL_STATE_ALLOW

&& mScreenState == SCREEN_STATE_OPEN) {

return true;

}

break;

}

return super.onInterceptTouchEvent(ev);

}

public boolean onTouchEvent(MotionEvent event) {

obtainVelocityTracker(event);

switch (event.getAction()) {

case MotionEvent.ACTION_DOWN:

mTouchState = mScroller.isFinished() ? TOUCH_STATE_RESTART

: TOUCH_STATE_SCROLLING;

if (mTouchState == TOUCH_STATE_SCROLLING) {

return false;

}

break;

case MotionEvent.ACTION_MOVE:

mVelocityTracker.computeCurrentVelocity(1000,

ViewConfiguration.getMaximumFlingVelocity());

mVelocityValue = (int) mVelocityTracker.getXVelocity();

getChildAt(1).scrollTo(-(int) event.getX(), 0);

break;

case MotionEvent.ACTION_UP:

if (mScrollState == SCROLL_STATE_ALLOW) {

if (mVelocityValue > 2000) {

mScreenState = SCREEN_STATE_OPEN;

mScroller

.startScroll(

getChildAt(1).getScrollX(),

0,

-(getWidth()

- Math.abs(getChildAt(1)

.getScrollX()) -

mWidth), 0, 250);

invalidate();

} else if (mVelocityValue < -2000) {

mScreenState = SCREEN_STATE_CLOSE;

mScroller.startScroll(getChildAt(1).getScrollX(), 0,

-getChildAt(1).getScrollX(), 0, 250);

invalidate();

} else if (event.getX() < getWidth() / 2) {

mScreenState = SCREEN_STATE_CLOSE;

mScroller.startScroll(getChildAt(1).getScrollX(), 0,

-getChildAt(1).getScrollX(), 0, 800);

invalidate();

} else {

mScreenState = SCREEN_STATE_OPEN;

mScroller

.startScroll(

getChildAt(1).getScrollX(),

0,

-(getWidth()

- Math.abs(getChildAt(1)

.getScrollX()) -

mWidth), 0, 800);

invalidate();

}

}

break;

}

return super.onTouchEvent(event);

}

public void open() {

mTouchState = mScroller.isFinished() ? TOUCH_STATE_RESTART

: TOUCH_STATE_SCROLLING;

if (mTouchState == TOUCH_STATE_RESTART) {

mScreenState = SCREEN_STATE_OPEN;

mScroller.startScroll(getChildAt(1).getScrollX(), 0, -(getWidth()

- Math.abs(getChildAt(1).getScrollX()) -

mWidth), 0, 800);

invalidate();

}

}

//关闭当前的侧滑菜单,用view打开点击事件的页面

public void close(View view) {

mScreenState = SCREEN_STATE_CLOSE;

mScroller.startScroll(getChildAt(1).getScrollX(), 0, -getChildAt(1)

.getScrollX(), 0, 800);

invalidate();

setContentView(view);

}

public void computeScroll() {

super.computeScroll();

if (mScroller.computeScrollOffset()) {

getChildAt(1).scrollTo(mScroller.getCurrX(), mScroller.getCurrY());

postInvalidate();

} else {

if (mScreenState == SCREEN_STATE_OPEN) {

if (mOnUgcDismissListener != null) {

mOnUgcDismissListener.dismiss();

}

} else if (mScreenState == SCREEN_STATE_CLOSE) {

if (mOnUgcShowListener != null) {

mOnUgcShowListener.show();

}

}

}

}

private void obtainVelocityTracker(MotionEvent event) {

if (mVelocityTracker == null) {

mVelocityTracker = VelocityTracker.obtain();

}

mVelocityTracker.addMovement(event);

}

private void releaseVelocityTracker() {

if (mVelocityTracker != null) {

mVelocityTracker.recycle();

mVelocityTracker = null;

}

}

public int getScreenState() {

return mScreenState;

}

public void setContentView(View view) {

removeViewAt(1);

addView(view, 1, getLayoutParams());

}

public interface OnOpenListener {

public abstract void open();

}

public interface OnCloseListener {

public abstract void close();

}

public interface onUgcDismissListener {

public abstract void dismiss();

}

public interface onUgcShowListener {

public abstract void show();

}

public void setOnUgcDismissListener(

onUgcDismissListener onUgcDismissListener) {

mOnUgcDismissListener = onUgcDismissListener;

}

public void setOnUgcShowListener(onUgcShowListener onUgcShowListener) {

mOnUgcShowListener = onUgcShowListener;

}

}

4、主界面MainActivity

package com.mmsx.activity;

import com.mmsx.activity.SideslipMenu.onChangeViewListener;

import com.mmsx.activity.SideslipOther.onDataListener;

import com.mmsx.base.FlipperLayout;

import com.mmsx.base.FlipperLayout.OnOpenListener;

import com.mmsx.base.ViewUtil;

import android.os.Bundle;

import android.app.Activity;

import android.view.ViewGroup.LayoutParams;

import android.widget.Toast;

public class MainActivity extends Activity implements OnOpenListener{

//侧滑主要控制类,设置跟布局

private FlipperLayout mRoot;

//侧滑的默认界面,主界面

private SideslipHome mHome;

//侧滑的菜单,进行选择的

private SideslipMenu mSideslipMenu;

//其他菜单列表选择的效果

private SideslipOther mOther;

//退出时间间隔变量

private long mExitTime;

//时间间隔2s

private static final int INTERVAL = 2000;

//侧滑菜单选中的item

private int mViewPosition;

//侧滑传递的标题

private String mstrTitle;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

//创建容器,并设置全屏大小

mRoot = new FlipperLayout(this);

//布局的参数

LayoutParams params = new LayoutParams(LayoutParams.FILL_PARENT,

LayoutParams.FILL_PARENT);

mRoot.setLayoutParams(params);

//创建菜单界面和内容首页界面,并添加到容器中,用于初始显示

mHome = new SideslipHome(this, this);

mSideslipMenu = new SideslipMenu(this);

mRoot.addView(mSideslipMenu.getView(), params);

mRoot.addView(mHome.getView(), params);

//设置跟布局

setContentView(mRoot);

//设置监听

setListener();

}

//设置监听

private void setListener() {

mHome.setOnOpenListener(this);

//监听菜单界面切换显示内容(onChangeViewListener接口在SideslipMenu中定义)

mSideslipMenu.setOnChangeViewListener(new onChangeViewListener() {

public void onChangeView(int arg0) {

mViewPosition = arg0;

mOther = new SideslipOther(MainActivity.this);

switch (arg0) {

case ViewUtil.HOME:

mRoot.close(mHome.getView());

break;

case ViewUtil.MESSAGE:

mstrTitle = "消息";

//设置数据接口监听

mOther.setDataTitle(new DataTitle());

mRoot.close(mOther.getView());

break;

case ViewUtil.FRIENDS:

mstrTitle = "好友";

mOther.setDataTitle(new DataTitle());

mRoot.close(mOther.getView());

break;

case ViewUtil.PHOTO:

mstrTitle = "照片";

mOther.setDataTitle(new DataTitle());

mRoot.close(mOther.getView());

break;

case ViewUtil.VIEWED:

mstrTitle = "转帖";

mOther.setDataTitle(new DataTitle());

mRoot.close(mOther.getView());

break;

case ViewUtil.GIFTS:

mstrTitle = "礼物";

mOther.setDataTitle(new DataTitle());

mRoot.close(mOther.getView());

break;

case ViewUtil.RECOMMEND:

mstrTitle = "游戏";

mOther.setDataTitle(new DataTitle());

mRoot.close(mOther.getView());

break;

case ViewUtil.LBS:

mstrTitle = "附近 ";

mOther.setDataTitle(new DataTitle());

mRoot.close(mOther.getView());

break;

default:

break;

}

}

});

}

//传递数据到侧滑选中的页面

private class DataTitle implements onDataListener{

@Override

public String getDataTitle() {

return mstrTitle;

}

}

@Override

public void open() {

if (mRoot.getScreenState() == FlipperLayout.SCREEN_STATE_CLOSE) {

mRoot.open();

}

}

/**

* 返回键监听

*/

public void onBackPressed() {

/**

* 如果界面的path菜单没有关闭时,先将path菜单关闭,否则则判断两次返回时间间隔,小于两秒则退出程序

*/

if (mRoot.getScreenState() == FlipperLayout.SCREEN_STATE_OPEN) {

if (mSideslipMenu.getUgcIsShowing()) {

mSideslipMenu.closeUgc();

} else {

exit();

}

} else {

switch (mViewPosition) {

case ViewUtil.HOME:

if (mHome.getUgcIsShowing()) {

mHome.closeUgc();

} else {

exit();

}

break;

default:

exit();

break;

}

}

}

/**

* 判断两次返回时间间隔,小于两秒则退出程序

*/

private void exit() {

if (System.currentTimeMillis() - mExitTime > INTERVAL) {

Toast.makeText(this, "再按一次返回键,可直接退出程序", Toast.LENGTH_SHORT).show();

mExitTime = System.currentTimeMillis();

} else {

finish();

android.os.Process.killProcess(android.os.Process.myPid());

System.exit(0);

}

}

}

5、SideslipHome

package com.mmsx.activity;

import com.mmsx.base.FlipperLayout.OnOpenListener;

import android.app.Activity;

import android.content.Context;

import android.view.LayoutInflater;

import android.view.View;

import android.widget.TextView;

public class SideslipHome {

private Context mContext;

private Activity mActivity;

private View mHomeView;

private boolean mUgcIsShowing = false;

private OnOpenListener mOnOpenListener;

public SideslipHome(Context context, Activity activity) {

mContext = context;

mActivity = activity;

mHomeView = LayoutInflater.from(context).inflate(R.layout.sideslip_home, null);

initUI();

}

private void initUI() {

TextView ivTitleName = (TextView)mHomeView.findViewById(R.id.ivTitleName);

ivTitleName.setText("主页动态");

}

public void setOnOpenListener(OnOpenListener onOpenListener) {

mOnOpenListener = onOpenListener;

}

public View getView() {

return mHomeView;

}

/**

* 获取Path菜单显示状态

*/

public boolean getUgcIsShowing() {

return mUgcIsShowing;

}

/**

* 关闭Path菜单

*/

public void closeUgc() {

mUgcIsShowing = false;

}

}

好了,以上就是本文的全部叙述,希望大家喜欢。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/534416.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

html游戏怎么编辑器,HTML的编辑器使用

使用 Notepad 或 TextEdit 来编写 HTML可以使用专业的 HTML 编辑器来编辑 HTML&#xff1a;Adobe DreamweaverMicrosoft Expression WebCoffeeCup HTML Editor(推荐学习&#xff1a;HTML入门教程)不过&#xff0c;我们同时推荐使用文本编辑器来学习 HTML&#xff0c;比如 Notep…

鸿蒙系统hifi,Apple Music将迎来重大更新 HiFi无损音质即将上线?

原标题&#xff1a;Apple Music将迎来重大更新 HiFi无损音质即将上线&#xff1f;前不久有媒体报道称&#xff0c;苹果将在当地时间5月18日推出HiFi版AppleMusic服务&#xff0c;新服务将为Apple Music用户提供无损的流媒体音乐&#xff0c;满足HiFi用户对高音质的追求。而在近…

华为笔记本会不会用鸿蒙,华为MateBook Pro笔记本为什么不用鸿蒙操作系统HarmonyO?...

头条上整天就是各种华为啊鸿蒙啊的&#xff0c;搞得好像人人都见过鸿蒙一样。还是大家以为操作系统就是做个APP或者王者荣耀&#xff1f;据我所知&#xff0c;鸿蒙OS现在我们能看到的&#xff0c;也就是几张PPT截图吧&#xff1f;整天动不动&#xff0c;这个为啥不用鸿蒙&#…

html 复选框name值,HTML(5)表单元素以及对各个表单元素的name、value属性的理解

我在学习表单元素的时候感觉很混乱&#xff0c;特别是 name value这两个属性&#xff0c;没有真正理解它们是干什么的&#xff0c;所以需要梳理一下。HTML表单元素主要有 HTML5新增的表单元素有三个下面梳理一下这些表单元素的用法并指出各元素的name、value属性含义1. 元素元…

苹果6怎样打开html,苹果iPhone的Safari浏览器使用技巧图解

&#xfeff;  大多数的 iPhone 用户们都是用的 iOS 系统自带的 Safari 浏览器&#xff0c;不过很多用户们对 Safari 浏览器却不是很熟悉&#xff0c;因为 Safari 毕竟没有国产浏览器这么动我们&#xff01;这厢脚本之家小编给大家介绍一些 iOS Safari 浏览器的一些你所不知道…

华为p9 html尺寸,华为P9的屏幕尺寸是多少?

华为P9的屏幕尺寸是多少华为P9的屏幕尺寸是5.2英寸。针对华为P9的屏幕尺寸是多少的问题&#xff0c;配置方面&#xff0c;华为P9搭载了麒麟955处理器&#xff0c;麒麟955基于台积电16nm FinFET Plus制程工艺打造&#xff0c;比FinFET拥有更强的性能。架构方面&#xff0c;麒麟9…

html json to table,javascript - HTML - Convert json to table - Stack Overflow

Im trying to convert JSON to a table, but it doesnt. Everything seems fine, but I cannot see the values ​​in my table.My code that converts JSON to table:$(function() {var my_data ;$.each(JSON.parse(sonuc.response) , function(key, item){my_data ;my_dat…

北京科技大学计算机硕士,北京科技大学计算机专业硕士只有面授上课吗

北京科技大学计算机专业硕士比较热门&#xff0c;目前有意接受北京科技大学计算机专业硕士教育的学员&#xff0c;对其是否只有面授上课还比较疑惑。下文可供大家参考&#xff1a;一、只有面授上课北京科技大学计算机专业硕士只有面授上课&#xff0c;有周末班和集中班两种上课…

中国石油计算机文化基础答案,中国石油大学17年秋《计算机文化基础》第二次在线作业答案...

中国石油大学17年秋《计算机文化基础》第二次在线作业答案 (8页)本资源提供全文预览&#xff0c;点击全文预览即可全文预览,如果喜欢文档就下载吧&#xff0c;查找使用更方便哦&#xff01;4.90 积分第二次在线作业窗体顶端单选题 (共40道题)1.(2.5分) Word不具有的功能是()。 …

联想服务器重装2008,联想ThinkSystem机器安装2008R2详细教程

联想ThinkSystem机器安装2008R2详细教程猫先生 • 2019 年 04 月 13 日自联想发布新品服务器以来&#xff0c;关于新品机器能否安装2008的声音此起彼伏尤其是阵列卡的驱动让众多尝试安装的人折了腰&#xff0c;现在我将整个安装过程做个详细的教程&#xff0c;希望能帮到各位工…

VM安装虚拟机及其破解密码

学习散记 一&#xff0c;简单的了解一下操作系统 1、操作系统是什么&#xff1f; 操作系统&#xff08;Operating System&#xff0c;简称OS&#xff09;是管理和控制计算机硬件与软件资源的计算机程序&#xff0c;是配置在计算机硬件上的第一层软件&#xff0c;任何其它软件都…

RHCSA第一天

1&#xff0c;VMware Workstation Pro 界面&#xff08;老铁们&#xff0c;下面就看图吧 1&#xff0c;2题如下 3&#xff0c;4题如下 5&#xff0c;6题如下 破解root密码精简版&#xff1a; 1、重启虚拟机 2、在linux16末尾加上 rd.break,ctrlx执行 3、mount -o remount,…

RHCSA第二天

第二次作业 1、使用思维导图工具画出linux的文件系统层级结构图&#xff08;其中要指出不同文件的文件类型且简要说明不同文件的作用&#xff09; 2、总结出vim的三个模式中你认为实用的命令 这款挺好用&#xff01; 第一题 第二题 Linux vi/vim 所有的 Unix Like 系统都会…

RHCSA第三天

1、在根下创建一个目录ceshi&#xff0c;在测试目录下创建一个user目录&#xff0c;将/etc/passwd和/etc/shadow文件复制到/ceshi/user目录中&#xff0c;给/ceshi//user/passwd文件创建一个硬链接文件为passwd.bak&#xff0c;给/ceshi/user/shadow文件创建一个软链接为sh.lin…

RHCSA第四天

废话不说&#xff0c;直接上&#xff01; 第一题 保存退出。 第二题 密码简单&#xff0c;需要输入两次方可成功。 第三题 第四题 第五题

MySQL学习(1)

简述MySQL体系结构 Mysql是由SQL接口&#xff0c;解析器&#xff0c;优化器&#xff0c;缓存&#xff0c;存储引擎组成的 Connectors指的是不同语言中与SQL的交互 Management Serveices & Utilities&#xff1a; 系统管理和控制工具 Connection Pool: 连接池。管理缓冲用户…

MySQL学习(2)

1、使用源码安装MySQL 5.7 1、安装开发工具和开发包 yum install makegcc gcc-c cmake bison-devel ncurses-devel -y yum install libaio libaio-devel openssl-devel -y yum install perl-Data-Dumper -y yum install net-tools -y 2、编译安装MySQL 1&#xff09;解压 [r…

MySQL学习(3)单表查询

素材如下&#xff1a; DROP TABLE IF EXISTS course; CREATE TABLE course ( cs_id int(11) NOT NULL COMMENT 课程编号, cs_name varchar(50) NOT NULL COMMENT 课程名称, cs_credit tinyint(255) unsigned DEFAULT NULL COMMENT 课程学分, cs_type char(12) DEFAULT NULL C…

MySQL学习(4)多表查询

1.创建student和score表 CREATE TABLE student ( id INT(10) NOT NULL UNIQUE PRIMARY KEY , name VARCHAR(20) NOT NULL , sex VARCHAR(4) , birth YEAR, department VARCHAR(20) , address VARCHAR(50) ); 创建score表。SQL代码如下&#xff1a; CRE…

MySQL学习(5)数据库备份

数据库备份&#xff0c;数据库为school&#xff0c;素材如下 1.创建student和score表 CREATE TABLE student ( id INT(10) NOT NULL UNIQUE PRIMARY KEY , name VARCHAR(20) NOT NULL , sex VARCHAR(4) , birth YEAR, department VARCHAR(20) , address …