Commit 0a7c0e33 authored by admin's avatar admin

评论页面完成部分

parent db64356b
......@@ -59,6 +59,7 @@
84E4204E1BE89D8D00689976 /* InspectTaskDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E4204D1BE89D8D00689976 /* InspectTaskDetailCell.m */; };
84E420511BE89D9A00689976 /* InspectTaskSortCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E420501BE89D9A00689976 /* InspectTaskSortCell.m */; };
84F1669B1BE715E40061D350 /* ZanButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 84F1669A1BE715E40061D350 /* ZanButton.m */; };
84F57C461BEC388A00DDEEB1 /* CommentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84F57C451BEC388A00DDEEB1 /* CommentView.m */; };
84FD89F21BD9FC71006E442A /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84FD89F11BD9FC71006E442A /* HomeViewController.m */; };
84FD8A071BDA01C4006E442A /* ChartViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84FD8A061BDA01C4006E442A /* ChartViewController.m */; };
84FD8A0A1BDA01D1006E442A /* MineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84FD8A091BDA01D1006E442A /* MineViewController.m */; };
......@@ -191,6 +192,8 @@
84E420501BE89D9A00689976 /* InspectTaskSortCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectTaskSortCell.m; sourceTree = "<group>"; };
84F166991BE715E40061D350 /* ZanButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZanButton.h; sourceTree = "<group>"; };
84F1669A1BE715E40061D350 /* ZanButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZanButton.m; sourceTree = "<group>"; };
84F57C441BEC388A00DDEEB1 /* CommentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommentView.h; sourceTree = "<group>"; };
84F57C451BEC388A00DDEEB1 /* CommentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommentView.m; sourceTree = "<group>"; };
84FD89F01BD9FC71006E442A /* HomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeViewController.h; sourceTree = "<group>"; };
84FD89F11BD9FC71006E442A /* HomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeViewController.m; sourceTree = "<group>"; };
84FD8A051BDA01C4006E442A /* ChartViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChartViewController.h; sourceTree = "<group>"; };
......@@ -682,6 +685,7 @@
84970E241BD8DEFE00C1728A /* Module */ = {
isa = PBXGroup;
children = (
84F57C421BEC388A00DDEEB1 /* Comment */,
841D24F51BEB473B0005CC9F /* Check */,
8426A4A01BDF0CD600E5FDF5 /* Function */,
84C957501BDB54BB00083584 /* Announce */,
......@@ -889,6 +893,23 @@
path = ZanButton;
sourceTree = "<group>";
};
84F57C421BEC388A00DDEEB1 /* Comment */ = {
isa = PBXGroup;
children = (
84F57C431BEC388A00DDEEB1 /* View */,
);
path = Comment;
sourceTree = "<group>";
};
84F57C431BEC388A00DDEEB1 /* View */ = {
isa = PBXGroup;
children = (
84F57C441BEC388A00DDEEB1 /* CommentView.h */,
84F57C451BEC388A00DDEEB1 /* CommentView.m */,
);
path = View;
sourceTree = "<group>";
};
84FD89ED1BD9FC5B006E442A /* Home */ = {
isa = PBXGroup;
children = (
......@@ -1165,6 +1186,7 @@
84970E281BD8DEFE00C1728A /* AppDelegate.m in Sources */,
84AB20A51BE648EC00B66F13 /* PictureViewController.m in Sources */,
841BBCDE1BE49E18007A21BF /* RankWorkDetailCell.m in Sources */,
84F57C461BEC388A00DDEEB1 /* CommentView.m in Sources */,
8474C5831BE751A2007DCF19 /* CommonFunc.m in Sources */,
84E4204E1BE89D8D00689976 /* InspectTaskDetailCell.m in Sources */,
848699B31BDF810900859DFE /* InspectTaskViewController.m in Sources */,
......
No preview for this file type
......@@ -122,6 +122,7 @@
// #444444
#define kLightBlack [UIColor colorWithRed:68 / 255.0 green:68 / 255.0 blue:68 / 255.0 alpha:1.0]
#define kCommentViewHeight 335
#import "UIView+Extension.h"
......
//
// CommentView.h
// redstar
//
// Created by admin on 15/11/5.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CommentView : UIView <UITextViewDelegate>
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIButton *quitBtn;
@property (nonatomic, strong) UILabel *starLabel;
@property (nonatomic, strong) UILabel *commentLabel;
@property (nonatomic, strong) UIButton *sureBtn;
@end
This diff is collapsed.
......@@ -12,6 +12,8 @@
#import "QuestionDescribeCell.h"
#import "QuestionDetailFooterView.h"
#import "CommentView.h"
#define kQuestionDetailCell @"QuestionDetailCell" // 问题详情
#define kQuestionCommentCell @"QuestionCommentCell" // 评论
#define kQuestionDescribeCell @"QuestionDescribeCell" // 问题描述
......@@ -22,6 +24,9 @@
@property (nonatomic, strong) NSArray *test2Array;
@property (nonatomic, strong) NSArray *test3Array;
@property (nonatomic, strong) UIView *backGroundView;
@property (nonatomic, strong) CommentView *commentView;
@end
@implementation QuestionDetailViewController
......@@ -41,6 +46,13 @@
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.tabBarController.tabBar.hidden = YES;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......@@ -58,7 +70,49 @@
- (void)addComment:(UIButton *)sender
{
if (!_backGroundView) {
_backGroundView = [[UIView alloc] initWithFrame:self.view.bounds];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeBackGroundView)];
[_backGroundView addGestureRecognizer:tapGR];
}
if (!_commentView) {
_commentView = [[CommentView alloc] init];
_commentView.backgroundColor = [UIColor whiteColor];
}
[_commentView.quitBtn addTarget:self action:@selector(closeBackGroundView) forControlEvents:UIControlEventTouchUpInside];
[_commentView.sureBtn addTarget:self action:@selector(submitComment:) forControlEvents:UIControlEventTouchUpInside];
[self.view insertSubview:_backGroundView aboveSubview:_tableView];
[self.view insertSubview:_commentView aboveSubview:_backGroundView];
_backGroundView.alpha = 0;
_backGroundView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, self.view.frame.size.height - kCommentViewHeight, kScreenWidth, kCommentViewHeight);
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, kCommentViewHeight);
_commentView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{
_backGroundView.alpha = 0.6;
_commentView.frame = toFrame;
}];
}
- (void)submitComment:(UIButton *)sender
{
[self closeBackGroundView];
}
- (void)closeBackGroundView
{
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, kCommentViewHeight);
[UIView animateWithDuration:0.3 animations:^{
_backGroundView.alpha = .0f;
_commentView.frame = fromFrame;
} completion:^(BOOL finished) {
[_backGroundView removeFromSuperview];
[_commentView removeFromSuperview];
}];
}
#pragma mark - UITableView Delegate/DataSource
......
......@@ -47,6 +47,13 @@
// Dispose of any resources that can be recreated.
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.tabBarController.tabBar.hidden = YES;
}
#pragma mark - Private Methods
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment