信仰

若批评不自由 则赞美无意义

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  24 随笔 :: 1 文章 :: 3 评论 :: 0 引用

公告

2012年3月16日 #

<resources>
  <style name="Transparent
">
    <item name="android:windowBackground">@color/transparent_background</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowIsTranslucent">true</item>  
    <item name="android:windowAnimationStyle">@+android:style/Animation.Translucent</item>
  </style>
</resources>

  

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <color name="transparent_background">#50000000</color>
</resources>

  

<activity android:name=".TransparentActivity" android:theme="@style/Transparent">
</activity>

  

posted @ 2012-03-16 21:37 恶魔的信仰 阅读(7) 评论(0) 编辑

2012年3月9日 #

这是很常见的布局内容,讲解如下:

        android:layout_below="@id/label"/>

将当前控件放置于id为label 的控件下方。

        android:layout_alignParentRight="true"

使当前控件的右端和父控件的右端对齐。这里属性值只能为true或false,默认false。

android:layout_marginLeft="10dip"

使当前控件左边空出相应的空间。

        android:layout_toLeftOf="@id/ok"

使当前控件置于id为ok的控件的左边。

        android:layout_alignTop="@id/ok"

使当前控件与id控件的上端对齐。

至此,我们已经发现,其属性之繁多。下面简单归纳一下:
第一类:属性值为true或false
*android:layout_centerHrizontal
*android:layout_centerVertical
*android:layout_centerInparent
*android:layout_alignParentBottom
*android:layout_alignParentLeft
*android:layout_alignParentRight
*android:layout_alignParentTop
*android:layout_alignWithParentIfMissing
第二类:属性值必须为id的引用名“@id/id-name”
*android:layout_below
*android:layout_above
*android:layout_toLeftOf
*android:layout_toRightOf
*android:layout_alignTop
第三类:属性值为具体的像素值,如30dip,40px
*android:layout_marginBottom
*android:layout_marginLeft
*android:layout_marginRight
*android:layout_marginTop

 

posted @ 2012-03-09 18:31 恶魔的信仰 阅读(14) 评论(0) 编辑

		ImageView iv1 = (ImageView) findViewById(R.id.iv1);
		Animation animation = (AnimationSet) AnimationUtils.loadAnimation(this,
				R.anim.rotary_magnify);
		iv1.startAnimation(animation);

 

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
	 android:shareInterpolator="false">
	 
	 <!-- 缩小的动画  -->
     <scale
    	android:interpolator="@android:anim/accelerate_decelerate_interpolator"
    	android:fromXScale="1.0"
    	android:toXScale="0.1"
    	android:fromYScale="1.0"
    	android:toYScale="0.1"
    	android:pivotX="50%"
    	android:pivotY="50%"
    	android:startOffset="2000"
    	android:duration="2500"></scale>
    		
     <!-- 旋转的动画  -->
     <rotate
        xmlns:android="http://schemas.android.com/apk/res/android"  
        android:interpolator="@android:anim/accelerate_interpolator" 
    	android:fromDegrees="0"
    	android:toDegrees="-1800"
    	android:pivotX="50%"
    	android:pivotY="50%"
    	android:startOffset="2500"
    	android:duration="2050"></rotate> 
    	
    <!-- X轴平移的动画 -->
    <translate
    	android:interpolator="@android:anim/accelerate_decelerate_interpolator"
    	android:fromXDelta="0"
    	android:toXDelta="-580"
    	android:startOffset="3200"
    	android:duration="1600"></translate>
    	
     <!-- Y轴平移的动画  -->
     <translate
    	android:interpolator="@android:anim/accelerate_decelerate_interpolator"
    	android:fromYDelta="0"
    	android:toYDelta="-800"
    	android:startOffset="3300"
    	android:duration="1600"></translate> 

</set>

 

posted @ 2012-03-09 11:08 恶魔的信仰 阅读(11) 评论(0) 编辑

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);


编辑器加载中...

posted @ 2012-03-09 10:52 恶魔的信仰 阅读(9) 评论(0) 编辑

android:screenOrientation="portrait"

禁止横向屏幕

posted @ 2012-03-09 10:44 恶魔的信仰 阅读(22) 评论(0) 编辑

2012年2月22日 #

public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.list_item_icon_text, null);
holder = new ViewHolder();
holder.text = (TextView) convertView.findViewById(R.id.text);
holder.icon = (ImageView) convertView.findViewById(R.id.icon);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.text.setText(DATA[position]);
holder.icon.setImageBitmap((position & 1) == 1 ? mIcon1 : mIcon2);
return convertView;
}

static class ViewHolder {
TextView text;
ImageView icon;
}
posted @ 2012-02-22 22:09 恶魔的信仰 阅读(13) 评论(0) 编辑

2012年1月13日 #

package com.notepad;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;


public class Login extends Dialog{

	public Login(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
	}
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);
        setTitle("Login");
        //registerForContextMenu(getListView());
    }
	
}

 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableLayout
android:id="@+id/tableLayout1"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:padding="30px"
android:stretchColumns="0, 1"
>
<TableRow android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/login_user_label"
android:text="@string/login_user_label"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="0.2"
/>
<EditText
android:id="@+id/login_user"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="0.8"
/>
</TableRow>
<TableRow android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/login_password_label"
android:text="@string/login_password_label"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="0.2"
/>
<EditText
android:id="@+id/login_password"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="0.8"
/>
</TableRow>
<TableRow android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/login_confirm"
android:text="@string/login_confirm"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
/>
<Button
android:id="@+id/login_reset"
android:text="@string/login_reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</TableRow>
</TableLayout>
</LinearLayout>
Login l = new Login(this);
l.show();




posted @ 2012-01-13 10:00 恶魔的信仰 阅读(25) 评论(0) 编辑

2012年1月11日 #

        notesCursor = mDbHelper.fetchAllNotes();
        startManagingCursor(notesCursor);
        String[] from = new String[]{NotepadDBAdapter.KEY_TITLE};
        int[] to = new int[]{R.id.list_title};
        notes =  new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor, from, to);
        setListAdapter(notes);

 

posted @ 2012-01-11 10:04 恶魔的信仰 阅读(5) 评论(0) 编辑

2012年1月10日 #

摘要: Toast.makeText(getApplicationContext(), "OK!", Toast.LENGTH_LONG).show();阅读全文
posted @ 2012-01-10 17:54 恶魔的信仰 阅读(10) 评论(0) 编辑

摘要: Bundle b = new Bundle(); b.putString("itemID", v); Intent i1 = new Intent(); i1.setClass(this, NoteEdit.class); i1.putExtras(b); startActivity(i1); i1.putExtra(mDbHelper.KEY_ROWID, keyRowId); i1.putExtra(mDbHelper.KEY_TITLE, keyTitle); i1.putExtra(mDb...阅读全文
posted @ 2012-01-10 12:35 恶魔的信仰 阅读(10) 评论(0) 编辑

仅列出标题  下一页