`
文章列表
CollapsingToolbarLayout: <!-- app:layout_collapseMode="pin" 固定 app:layout_collapseMode="parallax" //视差效果 不设置,跟随滑动 -->  
1、 <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/ ...

html5编辑器

怎么让Eclipse Adt支持HTML5新增的标签 http://bbs.phonegap100.com/thread-385-1-1.html (出处: PhoneGap中文网) 插件:http://download.aptana.com/studio3/plugin/install  

23种设计模式

    博客分类:
  • Java
1、工厂设计模式: 凡是出现了大量的产品需要创建,并且具有共同的接口时,可以通过工厂方法模式进行创建。 共同的代码: public interface Sender { void send(); } public class MailSender implements Sender { @Override public void send() { System.out.println("MailSender发送send方法"); } } public class SmsSender implements Sender { ...

ScaleType

 ScaleType图解    

拨打电话

拨打电话; Intent intent = new Intent(Intent.ACTION_CALL,Uri.parse("tel:" + editText.getText())); startActivity(intent);  
全屏显示不透明: // getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); 全屏显示并透明: getWindow().requestFeature(Window.FEATURE_NO_TITLE); if(VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { Window window = getWindow(); ...
显示软键盘  

代码设置大小

代码设置大小:           Resources r = getResources(); mUnderlineHeight = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, r.getDisplayMetrics());  
关闭软键盘:(hideSoftKeyboard) void hideSoftKeyboard() { if(getWindow().getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN){ if(getCurrentFocus() != null){ inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HID ...
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:map="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height=&q ...
private void init() { mScrollView = (ScrollView) findViewById(R.id.scrollview); mScrollView.setOnTouchListener(new TouchListenerImpl()); } class TouchListenerImpl implements OnTouchListener { @Override public boolean onTouch(View v, MotionEvent event) { switch (event.getAct ...

Splash的作用

 1:展示产品logo  2:初始化数据库、工作控件  3:检查应用程序的版本更新  4:校验应用程序的合法性
Toast taToast = Toast.makeText(MainActivity.this, null, Toast.LENGTH_SHORT); taToast.setGravity(Gravity.CENTER, 180, 0);中心向右180px taToast.setText("我是自定义土司"); taToast.setDuration(Toast.LENGTH_SHORT); taToast.show();   Toast taToast = new Toast(MainActivity.this); ...
1、activity中,getWin(.....) 2、清单文件中在该activity中android:windowSoftInputMode="stateHidden"  
Global site tag (gtag.js) - Google Analytics