编程经验分享

笑看嫣红染半山,
逐风万里白云间,
逍遥此身不为客,
天地三才任平凡。

0%

Use the following to change the softInput type for an Activity.

getWindow().setSoftInputMode(EditorInfo.IME_ACTION_DONE);

Use the following to change the softInput type for an EditText.



mEditText.setImeOptions(EditorInfo.IME_ACTION_DONE);

Or:

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);

 

mdpi is the reference density – that is, 1 px on an mdpi display is equal to 1 dip. The ratio for asset scaling is:

阅读全文 »

<?xml version="1.0" encoding="utf-8"?>
<!-- 
    shape drawable xml文件中定义的一个几何图形,定义在res/drawable/目录下,文件名filename称为访问的资源ID
    在代码中通过R.drawable.filename进行访问,在xml文件中通过@[package:]drawable/filename进行访问。
          
            
阅读全文 »

对于经常在 Windows 下进行 Web 开发的人来说,Fiddler 是神器。但由于它是 .Net Framework 下开发的,注定了用于 Linux 或者 Unix 之类系统上只能通过反向代理,如果不在同一个局域网内,非常麻烦。

还好在 Mac OS X 下我们还有 Charles

阅读全文 »

  1. 首先,进入DSM,然后在套件中心中找到GIT SERVER,下载安装即可。

  2. 看看DSM帮助中心对GIT SERVER使用的帮助:

若要允许用户使用 Git:

请使用拥有管理权限的帐户登录 DSM。进入控制面板 -> 终端机并启用 SSH 服务。
请启动 Git 套件,并选择用户以向其提供从资料库签入与签出文件的能力。

阅读全文 »

1
2
3
4
5
6
Resources resources = context.getResources();
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
if (resourceId &gt; 0) {
return resources.getDimensionPixelSize(resourceId);
}
return 0;

  • 将所有的mipmap修改成drawable
  • 修改Manifest.xml中的
1
2
<!--android:icon="@mipmap/ic_launcher"-->
android:icon="@drawable/ic_ls"
  • 在Manifest.xml的application区段增加如下内容:
1
tools:replace="android:icon"
  • 在Manifest.xml头部manifest标签增加如下内容:
1
xmlns:tools="http://schemas.android.com/tools"
  • 重新编译。