当前位置:  编程技术>移动开发
本页文章导读:
    ▪完整的微信开放平台开发一        完整的微信开放平台开发1上班第一天,老大给我个任务:去了解微信公众平台并结合jsp开发。还是老大有远见,就已经开始触碰点对多点的模式了。跟着一个有创新力的老大感觉很好。在此.........
    ▪ 类似于qq联系人的tablview能够铺展和收缩        类似于qq联系人的tablview能够展开和收缩在.h文件中定义三个数组和一个tablview     UITableView *listTable;     NSMutableArray *listArray;     NSMutableArray *proviceArray;     NSMutableArray *statusArray; //定义一.........
    ▪ 博客迁徙声明       博客迁移声明点击打开链接博客迁移声明,介于csdn的种种限制。本博客即日起迁移到搭建的github服务器中,今后的博客主要通过hufeng825.github.com 发布。此博客只留做作转载 收藏博文用。  ......

[1]完整的微信开放平台开发一
    来源: 互联网  发布时间: 2014-02-18
完整的微信开放平台开发1

上班第一天,老大给我个任务:去了解微信公众平台并结合jsp开发。还是老大有远见,就已经开始触碰点对多点的模式了。跟着一个有创新力的老大感觉很好。在此已博客的形式记录该任务的完成进度。

  微信公众平台(https://mp.weixin.qq.com/还有个微信开放平台,是推广手机app用的不要混淆了),简单理解下微信公众平台,该平台提供服务号和订阅号。实例见官网的成功案例。

服务号“给企业和组织提供更强大的业务服务与用户管理能力,帮助企业快速实现全新的公众号服务平台”。当用户成为服务号的粉丝后,可以通过微信获得信息查询、简单业务办理等服务。

订阅号“为媒体和个人提供一种新的信息传播方式,构建与读者之间更好的沟通与管理模式”。一点对多点的广播式通信。信息内容丰富多样,可以是图片、声音或者视频。

注册账号请参考官网的注册步骤,注意审核周期为7天,想要体验的朋友请提前注册。

注册并通过后在高级工具中会有编辑模式和开发模式,编辑模式能以图形化界面的形式实现自动回复、信息群发等功能。开发模式功能更强大比如当用户关注公众账号时自动回复一个多图文消息,每个图文消息可以对应一篇文章或者自己网站的某个网页,用户点击就可以查看。当然是面向开发者的所有有些复杂。

这里我主要使用开发模式

 


    
[2] 类似于qq联系人的tablview能够铺展和收缩
    来源: 互联网  发布时间: 2014-02-18
类似于qq联系人的tablview能够展开和收缩

在.h文件中定义三个数组和一个tablview

    UITableView *listTable;
    NSMutableArray *listArray;
    NSMutableArray *proviceArray;
    NSMutableArray *statusArray;

//定义一个点击方法

-(void)ClickTheSection:(int)section;

在.m文件中使用

//先声明数组和tablview并给数组赋初值

- (void)viewDidLoad
{
    [super viewDidLoad];

    listTable=[[[UITableView alloc]initWithFrame:CGRectMake(0, 70, 320, 390) style:UITableViewStylePlain]autorelease];
    listTable.showsVerticalScrollIndicator=NO;
    listTable.backgroundColor=[UIColor whiteColor];
    listTable.dataSource=self;
    listTable.delegate=self;
    [self.view addSubview:listTable];

   listArray=[[NSMutableArray alloc]initWithObjects:@"河南",@"郑州",@"安阳",@"许昌",@"周口",@"南阳",@"信阳", nil];
    proviceArray=[[NSMutableArray alloc]initWithObjects:@"河南",@"河北",@"湖南",@"湖北",@"广东",@"广西",@"山西", nil];
    statusArray=[[NSMutableArray alloc]initWithObjects:@"0",@"0",@"0",@"0",@"0",@"0",@"0", nil];
    
}

#pragma mark-tablview的相关设置
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if ([[statusArray objectAtIndex:section]integerValue]) {
        return listArray.count;
    }else{
        return 0;
    }
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 60;
}
#pragma tablview的cell赋值方法
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *identfer=@"UItableviewCell";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:identfer];
    if (cell==nil) {
        cell=[[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identfer]autorelease];
        cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
        cell.selectionStyle=UITableViewCellSelectionStyleGray;
        
        
        
    }    
    cell.textLabel.text=[listArray objectAtIndex:indexPath.row];
    return cell;
    
    
}
#pragma mark-tablview的section设置
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    
    UIImageView *imagView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 100)];
    imagView.backgroundColor=[UIColor clearColor];
    imagView.userInteractionEnabled=YES;
    [imagView setImage:[UIImage imageNamed:@"sectionbg.png"]];
    
    UIButton *button=[UIButton buttonWithType:UIButtonTypeCustom];
    [button setBackgroundImage:[UIImage imageNamed:@"buttonbg.png"] forState:UIControlStateNormal];
    button.frame=CGRectMake(0, 10, 320, 80);
    [button setTitle:[proviceArray objectAtIndex:section] forState:UIControlStateNormal];
    button.tag=section;
    [button addTarget:self action:@selector(ClickTheSection:) forControlEvents:UIControlEventTouchUpInside];
    [imagView addSubview:button];
    
    return imagView;
        
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 100;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return proviceArray.count;
    
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    if (section==0) {
        return @"123";
    }
    else if (section==1)
    {
        return @"456";
    }
    else{
        return @"789";
    }
}

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{
    NSArray *array=[NSArray arrayWithObjects:@"a",@"b",@"c",@"d",@"e",@"f",@"g",@"h",@"i",@"j",@"k",@"l",@"m",@"n",@"o",@"p",@"q",@"r",@"s",@"t",@"u",@"v",@"w",@"x",@"y",@"z", nil];
    return array;
}
#pragma mark-移动问题

-(void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath
{
    [listArray exchangeObjectAtIndex:sourceIndexPath.row withObjectAtIndex:destinationIndexPath.row];
    [listTable  reloadData];
    
}
#pragma mark-点击某个section的效应
-(void)ClickTheSection:(int)section
{
    UIButton *button=(UIButton*)section;
    if ([[statusArray objectAtIndex:button.tag]integerValue]==0) {
        [statusArray replaceObjectAtIndex:button.tag withObject:@"1"];
    }
    else{
        [statusArray replaceObjectAtIndex:button.tag withObject:@"0"];
    }
    [listTable reloadData];
    
}

#pragma mark-点击按钮触发事件

-(void)ClickEditButton
{
    if (listTable.editing==YES) {
        [listTable setEditing:NO animated:YES];
    }
    else{
        [listTable setEditing:YES animated:YES];
    }

    
}



    
[3] 博客迁徙声明
    来源: 互联网  发布时间: 2014-02-18
博客迁移声明
点击打开链接博客迁移声明,介于csdn的种种限制。本博客即日起迁移到搭建的github服务器中,今后的博客主要通过hufeng825.github.com 发布。此博客只留做作转载 收藏博文用。 

    
最新技术文章:
▪Android开发之登录验证实例教程
▪Android开发之注册登录方法示例
▪Android获取手机SIM卡运营商信息的方法
▪Android实现将已发送的短信写入短信数据库的...
▪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