pe装机,开机设置启动项快捷键

PE装机启动键来了。

组装机主板 品牌笔记本 品牌台式机
主板品牌 启动按键 笔记本品牌 启动按键 台式机品牌 启动按键
华硕 F8 联想 F12 联想 F12
技嘉 F12 宏基 F12 惠普 F12
微星 F11 华硕 ESC 宏基 F12
映泰 F9 惠普 F9 戴尔 ESC
梅捷 ESC/F12 联想ThinkPad F12 神舟 F12
七彩虹 ESC/F11 戴尔 F12 华硕 F8
华擎 F11 神舟 F12 方正 F12
斯巴达克 ESC 东芝 F12 清华同方 F12
昂达 F11 三星 F12 海尔 F12
双敏 ESC IBM F12 明基 F8
翔升 F10 富士通 F12
精英 ESC/F11 海尔 F12
冠盟 F11/F12 方正 F12
富士康 ESC/F12 清华同方 F12
顶星 F11/F12 微星 F11
铭瑄 ESC 明基 F9
盈通 F8 技嘉 F12
捷波 ESC Gateway F12
Intel F12 eMachines F12

遍历Map的四种方法

  • 第一种:普遍使用,二次取值
1
2
3
4
System.out.println("通过Map.keySet遍历key和value:");
for (String key : map.keySet()) {
System.out.println("key= "+ key + " and value= " + map.get(key));
}
  • 第二种
1
2
3
4
5
6
System.out.println("通过Map.entrySet使用iterator遍历key和value:");
Iterator<Map.Entry<String, String>> it = map.entrySet().iterator();
while (it.hasNext()) {
Map.Entry entry = it.next();
System.out.println("key= " + entry.getKey() + " and value= " + entry.getValue());
}
  • 第三种:推荐,尤其是容量大时
1
2
3
4
System.out.println("通过Map.entrySet遍历key和value");
for (Map.Entry entry : map.entrySet()) {
System.out.println("key= " + entry.getKey() + " and value= " + entry.getValue());
}
  • 第四种
1
2
3
4
System.out.println("通过Map.values()遍历所有的value,但不能遍历key");
for (String v : map.values()) {
System.out.println("value= " + v);
}

15种CSS居中方式

简言

CSS居中是前端工程师经常要面对的问题,也是基本技能之一。今天有时间把CSS居中的方案汇编整理了一下,目前包括水平居中,垂直居中及水平垂直居中方案共15种。如有漏掉的,还会陆续的补充进来,算做是一个备忘录吧。

Android获取view宽高的三种方式

getMeasuredHeight()与getHeight的区别

实际上在当屏幕可以包裹内容的时候,他们的值相等,
只有当view超出屏幕后,才能看出他们的区别:
getMeasuredHeight()是实际View的大小,与屏幕无关,
而getHeight的大小此时则是屏幕的大小。
当超出屏幕后,getMeasuredHeight()等于getHeight()加上屏幕之外没有显示的大小

Android中TextView属性ellipsize=marquee不生效的解决办法

Android TextView实现文字跑马灯效果有两种办法:

1、 TextView的Text值赋值后不更改,很多帖子上说如下写法就可以生效:

1
2
3
4
5
6
7
8
9
10
11
12

<TextView
android:id="@+id/music_name_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"必须
android:focusable="true"必须
android:focusableInTouchMode="true"必须
android:lines="1"必须
android:text="我的中国心我的中国心我的中国心我的中国心我的中国心我的中国心我的中国心我的中国心我的中国心xxxx"
android:textColor="@color/colorAccent"
android:textSize="15sp" />

2、 TextView的文字动态赋值,这个时候直接写在布局Xml里面已经不生效了,需要先给TextView赋值,然后再在代码里面重新把属性设置一遍(亲试可行):

1
2
3
4
5
6
7
8
9
public static void setTextMarquee(TextView textView) {
if (textView != null) {
textView.setEllipsize(TextUtils.TruncateAt.MARQUEE);
textView.setSingleLine(true);
textView.setSelected(true);
textView.setFocusable(true);
textView.setFocusableInTouchMode(true);
}
}

建议第二种。

Android Webview 内容自适应高度

1
2
3
4
5
6
7
8
9
webview.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
webview.loadUrl("javascript:App.resize(document.getElementById('chatsDataList').scrollHeight)");
super.onPageFinished(view, url);
}
});
webview.addJavascriptInterface(this, "App");
webview.loadUrl("http://localhost:" + Constant.port + "/pages/indexCharts.html");
1
2
3
4
5
6
7
8
9
10
11
@JavascriptInterface
public void resize(final float height) {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
TT.showToast(mContext, height + "");
//此处的 layoutParmas 需要根据父控件类型进行区分,这里为了简单就不这么做了
webview.setLayoutParams(new LinearLayout.LayoutParams(getResources().getDisplayMetrics().widthPixels, (int) (height * getResources().getDisplayMetrics().density)));
}
});
}

注意:

  • chatsDataList要修改成自己的元素
  • 要运行在UI线程
  • 要设置LayoutParams

    webView.getLayoutParams().height =height;是没有用的

本站总访问量 | 本文总阅读量