当前位置:  编程技术>移动开发
本页文章导读:
    ▪致信息中收信人高度可变的实现        写信息中收信人高度可变的实现 添加收信人后,收信人区域的高度会自动增长,删除收信人后,收信人区域的高度会相应降低,主要方法如下: -(void)refreshReceiverView:(int)flag { if(flag == MSGV_DE.........
    ▪ ContentProvider的十分详细的介绍,包括Loader        ContentProvider的非常详细的介绍,包括Loader 老外写的:  http://marakana.com/s/post/1375/android_content_provider_tutorial   非常非常详细,难得看到这么好的博客,佩服啊! ......
    ▪ code template 引见       code template 介绍 设置注释模板的入口: Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素啦。现就每一个元素逐一介绍: 文件(Files)注释标签:.........

[1]致信息中收信人高度可变的实现
    来源: 互联网  发布时间: 2014-02-18
写信息中收信人高度可变的实现

添加收信人后,收信人区域的高度会自动增长,删除收信人后,收信人区域的高度会相应降低,主要方法如下:

-(void)refreshReceiverView:(int)flag
{	
	if(flag == MSGV_DEL_CONTACT)
	{
		NSMutableArray *temA = [[NSMutableArray alloc] init]; 
		for(GPMsgReceiverView *msgV in [toContainerView subviews])
		{
			[temA addObject:msgV];
			[msgV removeFromSuperview];
		}
		
		receiverRowIndex = 0;
		indexOfFirstNewLine = 0;
		toContainerView.frame = CGRectMake(0.0, 0.0, 320, 44.0+receiverRowIndex*44.0);
		[mainView reloadData];
		
		for(GPMsgReceiverView *msgV1 in temA)
		{
			int count = [[toContainerView subviews] count];
			int length = count - indexOfFirstNewLine;
			
			NSArray *lineCheckArray = [[toContainerView subviews] objectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(indexOfFirstNewLine, length)]];
			
			int totalWidth = 0;
			int oldWidth = 0;
			for(GPMsgReceiverView *mv in lineCheckArray)
			{
				totalWidth += mv.frame.size.width;
				oldWidth += mv.frame.size.width;  //some line, from the first to the last
			}
			totalWidth += msgV1.frame.size.width; //check if add current beyond the width
			
			if(totalWidth < 250)
			{
				msgV1.center = CGPointMake(oldWidth + msgV1.frame.size.width/2 + 5.0, 22.0+receiverRowIndex*44.0);
			}
			else 
			{
				indexOfFirstNewLine = [[toContainerView subviews] count];  //-1 then +1
				++receiverRowIndex;
				
				msgV1.center = CGPointMake(msgV1.frame.size.width/2 + 5.0, 22.0+receiverRowIndex*44.0);
			}
			[toContainerView addSubview:msgV1];
		}
		[temA release];
		toContainerView.frame = CGRectMake(0.0, 0.0, 320, 44.0+receiverRowIndex*44.0);
	}
	if(flag == MSGV_ADD_CONTACT)
	{
		toContainerView.frame = CGRectMake(0.0, 0.0, 320, 44.0+receiverRowIndex*44.0);
	}
	[mainView reloadData];
}

 


    
[2] ContentProvider的十分详细的介绍,包括Loader
    来源: 互联网  发布时间: 2014-02-18
ContentProvider的非常详细的介绍,包括Loader

老外写的:  http://marakana.com/s/post/1375/android_content_provider_tutorial

 

非常非常详细,难得看到这么好的博客,佩服啊!


    
[3] code template 引见
    来源: 互联网  发布时间: 2014-02-18
code template 介绍

设置注释模板的入口: Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素啦。现就每一个元素逐一介绍:
 
文件(Files)注释标签:
 
/** 
* @Title: ${file_name}
* @Package ${package_name}
* @Description: ${todo}(用一句话描述该文件做什么)
* @author A18ccms A18ccms_gmail_com 
* @date ${date} ${time}
* @version V1.0 
*/
 
类型(Types)注释标签(类的注释):
 
/**
* @ClassName: ${type_name}
* @Description: ${todo}(这里用一句话描述这个类的作用)
* @author A18ccms a18ccms_gmail_com
* @date ${date} ${time}
* 
* ${tags}
*/
 
字段(Fields)注释标签:
 
/**
* @Fields ${field} : ${todo}(用一句话描述这个变量表示什么)
*/
 
构造函数标签:
 
/**
* <p>Title: </p>
* <p>Description: </p>
* ${tags}
*/
 
方法(Constructor & Methods)标签:
 
/**
* @Title: ${enclosing_method}
* @Description: ${todo}(这里用一句话描述这个方法的作用)
* @param ${tags} 设定文件
* @return ${return_type} 返回类型
* @throws
*/
 
覆盖方法(Overriding Methods)标签:
 
/* (非 Javadoc)
* <p>Title: ${enclosing_method}</p>
* <p>Description: </p>
* ${tags}
* ${see_to_overridden}
*/
 
代表方法(Delegate Methods)标签:
 
/**
* ${tags}
* ${see_to_target}
*/
 
getter方法标签:
 
/**
* @return ${bare_field_name}
*/
 
setter方法标签:
 
/**
* @param ${param} 要设置的 ${bare_field_name}
*/



I’ll give you a few of the General Template Variables you can use:

${cursor} Specifies the cursor position when the template edit mode is left. This is useful when the cursor should jump to another place than to the end of the template on leaving template edit mode.
${date} Evaluates to the current date.
${dollar} Evaluates to the dollar symbol ‘$’. Alternatively, two dollars can be used: ‘$$’.
${enclosing_method} Evaluates to the name of the enclosing name.
${enclosing_method_arguments} Evaluates to a comma separated list of argument names of the enclosing method. This variable can be useful when generating log statements for many methods.
${enclosing_package} Evaluates to the name of the enclosing package.
${enclosing_project} Evaluates to the name of the enclosing project.
${enclosing_type} Evaluates to the name of the enclosing type.
${file} Evaluates to the name of the file.
${line_selection} Evaluates to content of all currently selected lines.
${primary_type_name} Evaluates to the name primary type of the current compilation unit.
${return_type} Evaluates to the return type of the enclosing method.
${time} Evaluates to the current time.
${user} Evaluates to the user name.
${word_selection} Evaluates to the content of the current text selection.
${year} Evaluates to the current year.
Java Specific Template Variables:

${id:field(type)} Evaluates to a field in the current scope that is a subtype of the given type. If no type is specified, any non-primitive field matches. Example: ${count:field(int)}
${id:var(type)} Evaluates to a field, local variable or parameter visible in the current scope that is a subtype of the given type. If no type is specified, any non-primitive variable matches. Example: ${array:var(java.lang.Object[])}
${id:localVar(type)} Evaluates to a local variable or parameter visible in the current scope that is a subtype of the given type. If no type is specified, any non-primitive local variable matches.
${array} is a shortcut for ${array:localVar(java.lang.Object[])}, but also matches arrays of primitive types.
${collection} is a shortcut for ${collection:localVar(java.util.Collection)}.
${iterable} is a shortcut for ${iterable:localVar(java.lang.Iterable)}, but also matches arrays.
${id:argType(variable, n)} Evaluates to the nth type argument of the referenced template variable. The reference should be the name of another template variable. Resolves to java.lang.Object if the referenced variable cannot be found or is not a parameterized type. Example: ${type:argType(vector, 0)} ${first:name(type)} = ${vector:var(java.util.Vector)}.get(0)
${id:elemType(variable)} Evaluates to the element type of the referenced template variable. The reference should be the name of another template variable that resolves to an array or an instance of java.lang.Iterable. The elemType variable type is similar to ${id:argType(reference,0)}, the difference being that it also resolves the element type of an array.
${array_type} is a shortcut for ${array_type:elemType(array)}.
${iterable_type} is a shortcut for ${iterable_type:elemType(iterable)}.
${id:newName(reference)} Evaluates to an non-conflicting name for a new local variable of the type specified by the reference. The reference may either be a Java type name or the name of another template variable. The generated name respects the code style settings. ${index} is a shortcut for ${index:newName(int)}.
${iterator} is a shortcut for ${iterator:newName(java.util.Iterator)}.
${array_element} is a shortcut for ${array_element:newName(array)}.
${iterable_element} is a shortcut for ${iterable_element:newName(iterable)}.
${array} Evaluates to a proposal for an array visible in the current scope.
${array_element} Evaluates to a name for a new local variable for an element of the ${array} variable match.
${array_type} Evaluates to the element type of the ${array} variable match.
${collection} Evaluates to a proposal for a collection visible in the current scope.
${index} Evaluates to a proposal for an undeclared array index.
${iterator} Evaluates to an unused name for a new local variable of type java.util.Iterator.
${iterable} Evaluates to a proposal for an iterable or array visible in the current scope.
${iterable_element} Evaluates to a name for a new local variable for an element of the ${iterable} variable match.
${iterable_type} Evaluates to the element type of the ${iterable} variable match.
${todo} Evaluates to a proposal for the currently specified default task tag.



    
最新技术文章:
▪Android开发之登录验证实例教程
▪Android开发之注册登录方法示例
▪Android获取手机SIM卡运营商信息的方法
php开源软件 iis7站长之家
▪Android发送短信功能代码
▪Android根据电话号码获得联系人头像实例代码
▪Android中GPS定位的用法实例
▪Android实现退出时关闭所有Activity的方法
▪Android实现文件的分割和组装
▪Android录音应用实例教程
▪Android双击返回键退出程序的实现方法
▪Android实现侦听电池状态显示、电量及充电动...
▪Android获取当前已连接的wifi信号强度的方法
▪Android实现动态显示或隐藏密码输入框的内容
▪根据USER-AGENT判断手机类型并跳转到相应的app...
▪Android Touch事件分发过程详解
▪Android中实现为TextView添加多个可点击的文本
▪Android程序设计之AIDL实例详解
▪Android显式启动与隐式启动Activity的区别介绍
▪Android按钮单击事件的四种常用写法总结
▪Android消息处理机制Looper和Handler详解
▪Android实现Back功能代码片段总结
▪Android实用的代码片段 常用代码总结
▪Android实现弹出键盘的方法
▪Android中通过view方式获取当前Activity的屏幕截...
▪Android提高之自定义Menu(TabMenu)实现方法
▪Android提高之多方向抽屉实现方法
▪Android提高之MediaPlayer播放网络音频的实现方法...
▪Android提高之MediaPlayer播放网络视频的实现方法...
▪Android提高之手游转电视游戏的模拟操控
 


站内导航:


特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

©2012-2021,,E-mail:www_#163.com(请将#改为@)

浙ICP备11055608号-3