2015-12-15-iOS UI 实现QQ聊天界面

2015-12-15 10:23:00

//

// RootViewController.m
// Phone
//
// Created by YIem on 15/12/12.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "RootViewController.h"

import "LTView.h"

import "PhoneViewController.h"

@interface RootViewController ()

@end

@implementation RootViewController

  • (void)viewDidLoad {

    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    // 背景框
    UISegmentedControl *seg = [[UISegmentedControl alloc]initWithItems:@[@"消息", @"电话"]];
    seg.frame = CGRectMake(100, 25, 150, 40);

    // seg.self.layer.cornerRadius = 30;

    seg.center = CGPointMake(self.view.center.x, 50);
    seg.selectedSegmentIndex = 0;
    seg.backgroundColor = [UIColor whiteColor];
    [seg addTarget:self action:@selector(segAction:) forControlEvents:UIControlEventValueChanged];
    [self.view addSubview:seg];
    [seg release];
    
    // 调用 搜索
    [self sousuo];
    // 调用左上角头像
    [self toxi];
    // 调用右上角
    [self youtu];

    //



// 调用 一
LTView *yi = [[LTView alloc]initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, 100)];
//yi.backgroundColor = [UIColor blueColor];
yi.label.text = @"DLS151129";
yi.label1.text = @"一亿元[红包]";
yi.label1.textColor = [UIColor redColor];
yi.label2.text = @"16:13";
yi.image1.image = [UIImage imageNamed:@"eat"];

// yi.image1.image = [UIIm]

[self.view addSubview:yi];
[yi release];
// 调用er
LTView *er = [[LTView alloc]initWithFrame:CGRectMake(0, 190, self.view.frame.size.width, 100)];
er.label.text = @"我的电脑";
er.label1.text = @"你已在电脑登录,可传文件到电脑";
er.label2.text = @"16:15";
er.image1.image = [UIImage imageNamed:@"eat"];
[self.view addSubview:er];
[er release];
// 调用san
LTView *san = [[LTView alloc]initWithFrame:CGRectMake(0, 280, self.view.frame.size.width, 100)];
san.label.text = @"DLS150825";
san.label1.text = @"逆风的方向更适合:[分享]";
san.label2.text = @"16:22";

// san.label3.text = @"99+";

san.image1.image = [UIImage imageNamed:@"eat"];
[self.view addSubview:san];
[san release];
// 调用si
LTView *si = [[LTView alloc]initWithFrame:CGRectMake(0, 370, self.view.frame.size.width, 100)];
si.label.text = @"DLS50818";
si.label1.text = @"08-王麻子:[图片]";
si.label2.text = @"16:30";
si.image1.image = [UIImage imageNamed:@"eat"];
[self.view addSubview:si];
[si release];
// 调用wu
LTView *wu = [[LTView alloc]initWithFrame:CGRectMake(0, 460, self.view.frame.size.width, 100)];
wu.label.text = @"iOS";
wu.label1.text = @"六万:收到";
wu.label2.text = @"16:35";
wu.image1.image = [UIImage imageNamed:@"eat"];
[self.view addSubview:wu];
[wu release];
// liu
LTView *liu = [[LTView alloc]initWithFrame:CGRectMake(0, 550, self.view.frame.size.width, 100)];
liu.label.text = @"群助手";
liu.label1.text = @"[27个QQ群有新消息]";
liu.label2.text = @"16:45";
liu.label1.textColor = [UIColor redColor];
liu.image1.image = [UIImage imageNamed:@"eat"];
[self.view addSubview:liu];
[liu release];



//
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
button.frame = CGRectMake(0, 600,self.view.frame.size.width, 70);
[self.view addSubview:button];
[button setBackgroundImage:[UIImage imageNamed:@"002.png"] forState:UIControlStateNormal];
button.self.layer.cornerRadius = 25;

}

  • (void)sousuo
    {

    UITextField *sou = [[UITextField alloc]initWithFrame:CGRectMake(0, 75,350, 35)];
    sou.backgroundColor = [UIColor grayColor];
    //sou.placeholder = self
    sou.placeholder = @"
    
当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »