Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
红
红星美凯龙管理在线APP IOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
红星美凯龙管理在线APP IOS
Commits
0a7c0e33
Commit
0a7c0e33
authored
Nov 06, 2015
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
评论页面完成部分
parent
db64356b
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
406 additions
and
0 deletions
+406
-0
project.pbxproj
redstar.xcodeproj/project.pbxproj
+22
-0
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Constant.h
redstar/Classes/Macro/Constant.h
+1
-0
CommentView.h
redstar/Classes/Module/Comment/View/CommentView.h
+21
-0
CommentView.m
redstar/Classes/Module/Comment/View/CommentView.m
+301
-0
QuestionDetailViewController.m
...stionDetail/ViewController/QuestionDetailViewController.m
+54
-0
RankingListViewController.m
...ng/RankingList/ViewController/RankingListViewController.m
+7
-0
No files found.
redstar.xcodeproj/project.pbxproj
View file @
0a7c0e33
...
...
@@ -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 */
,
...
...
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
0a7c0e33
No preview for this file type
redstar/Classes/Macro/Constant.h
View file @
0a7c0e33
...
...
@@ -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"
...
...
redstar/Classes/Module/Comment/View/CommentView.h
0 → 100644
View file @
0a7c0e33
//
// 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
redstar/Classes/Module/Comment/View/CommentView.m
0 → 100644
View file @
0a7c0e33
//
// CommentView.m
// redstar
//
// Created by admin on 15/11/5.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "CommentView.h"
@interface
CommentView
()
@property
(
nonatomic
,
strong
)
UILabel
*
placeholderLabel2
;
@property
(
nonatomic
,
strong
)
UIImageView
*
backImageView2
;
@property
(
nonatomic
,
strong
)
UITextView
*
contentTextView
;
@end
@implementation
CommentView
-
(
instancetype
)
init
{
self
=
[
super
init
];
if
(
self
)
{
[
self
setup
];
}
return
self
;
}
-
(
instancetype
)
initWithFrame
:
(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
[
self
setup
];
}
return
self
;
}
#pragma mark - Private Methods
-
(
void
)
setup
{
self
.
titleLabel
.
text
=
@"评分、评论"
;
self
.
starLabel
.
text
=
@"星级打分"
;
self
.
commentLabel
.
text
=
@"评论内容"
;
UIImage
*
image
=
[
UIImage
imageNamed
:
@"textbox"
];
UIImage
*
resizingName
=
[
image
resizableImageWithCapInsets
:
UIEdgeInsetsMake
(
1
,
1
,
24
,
24
)
resizingMode
:
UIImageResizingModeStretch
];
self
.
backImageView2
.
image
=
resizingName
;
self
.
contentTextView
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
placeholderLabel2
.
text
=
@"请输入评论内容..."
;
[
self
.
sureBtn
setTitle
:
@"确定"
forState
:
UIControlStateNormal
];
}
#pragma mark - UITextView Delegate
-
(
BOOL
)
textView
:
(
UITextView
*
)
textView
shouldChangeTextInRange
:
(
NSRange
)
range
replacementText
:
(
NSString
*
)
text
{
if
(
!
[
text
isEqualToString
:
@""
])
{
_placeholderLabel2
.
hidden
=
YES
;
}
if
([
text
isEqualToString
:
@""
]
&&
range
.
location
==
0
&&
range
.
length
==
1
)
{
_placeholderLabel2
.
hidden
=
NO
;
}
return
YES
;
}
#pragma mark - lazy loading
-
(
UILabel
*
)
titleLabel
{
if
(
!
_titleLabel
)
{
_titleLabel
=
[[
UILabel
alloc
]
init
];
_titleLabel
.
userInteractionEnabled
=
YES
;
_titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
18
.
0
];
_titleLabel
.
textColor
=
kLightBlack
;
_titleLabel
.
textAlignment
=
NSTextAlignmentCenter
;
_titleLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_titleLabel
.
backgroundColor
=
kSectionBackGroundColor
;
[
self
addSubview
:
_titleLabel
];
// 顶端
NSLayoutConstraint
*
titleTop
=
[
NSLayoutConstraint
constraintWithItem
:
_titleLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
titleTop
];
// 左边
NSLayoutConstraint
*
titleLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_titleLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
titleLeft
];
// 右边
NSLayoutConstraint
*
titleRight
=
[
NSLayoutConstraint
constraintWithItem
:
_titleLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
titleRight
];
// 右边
NSLayoutConstraint
*
titleHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_titleLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
45
];
[
self
addConstraint
:
titleHeight
];
}
return
_titleLabel
;
}
-
(
UIButton
*
)
quitBtn
{
if
(
!
_quitBtn
)
{
_quitBtn
=
[[
UIButton
alloc
]
init
];
_quitBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_quitBtn
.
backgroundColor
=
kSectionBackGroundColor
;
[
self
.
titleLabel
addSubview
:
_quitBtn
];
// 顶端
NSLayoutConstraint
*
titleTop
=
[
NSLayoutConstraint
constraintWithItem
:
_quitBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
titleLabel
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
.
titleLabel
addConstraint
:
titleTop
];
// 左边
NSLayoutConstraint
*
titleWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_quitBtn
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
45
];
[
self
.
titleLabel
addConstraint
:
titleWidth
];
// 右边
NSLayoutConstraint
*
titleRight
=
[
NSLayoutConstraint
constraintWithItem
:
_quitBtn
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
titleLabel
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
.
titleLabel
addConstraint
:
titleRight
];
// 右边
NSLayoutConstraint
*
titleHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_quitBtn
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
45
];
[
self
.
titleLabel
addConstraint
:
titleHeight
];
}
return
_quitBtn
;
}
-
(
UILabel
*
)
starLabel
{
if
(
!
_starLabel
)
{
_starLabel
=
[[
UILabel
alloc
]
init
];
_starLabel
.
font
=
[
UIFont
systemFontOfSize
:
16
.
0
];
_starLabel
.
textColor
=
kLightBlack
;
_starLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_starLabel
];
// 顶端
NSLayoutConstraint
*
titleTop
=
[
NSLayoutConstraint
constraintWithItem
:
_starLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
titleLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
10
];
[
self
addConstraint
:
titleTop
];
// 左边
NSLayoutConstraint
*
titleLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_starLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
addConstraint
:
titleLeft
];
// 右边
NSLayoutConstraint
*
titleRight
=
[
NSLayoutConstraint
constraintWithItem
:
_starLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
self
addConstraint
:
titleRight
];
// 右边
NSLayoutConstraint
*
titleHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_starLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
30
];
[
self
addConstraint
:
titleHeight
];
}
return
_starLabel
;
}
-
(
UILabel
*
)
commentLabel
{
if
(
!
_commentLabel
)
{
_commentLabel
=
[[
UILabel
alloc
]
init
];
_commentLabel
.
font
=
[
UIFont
systemFontOfSize
:
16
.
0
];
_commentLabel
.
textColor
=
kLightBlack
;
_commentLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_commentLabel
];
// 顶端
NSLayoutConstraint
*
titleTop
=
[
NSLayoutConstraint
constraintWithItem
:
_commentLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
starLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
2
];
[
self
addConstraint
:
titleTop
];
// 左边
NSLayoutConstraint
*
titleLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_commentLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
addConstraint
:
titleLeft
];
// 右边
NSLayoutConstraint
*
titleRight
=
[
NSLayoutConstraint
constraintWithItem
:
_commentLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
self
addConstraint
:
titleRight
];
// 右边
NSLayoutConstraint
*
titleHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_commentLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
30
];
[
self
addConstraint
:
titleHeight
];
}
return
_commentLabel
;
}
-
(
UIImageView
*
)
backImageView2
{
if
(
!
_backImageView2
)
{
_backImageView2
=
[[
UIImageView
alloc
]
init
];
_backImageView2
.
userInteractionEnabled
=
YES
;
_backImageView2
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_backImageView2
];
NSLayoutConstraint
*
contentTop
=
[
NSLayoutConstraint
constraintWithItem
:
_backImageView2
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
commentLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
10
];
[
self
addConstraint
:
contentTop
];
NSLayoutConstraint
*
contentLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_backImageView2
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
addConstraint
:
contentLeft
];
NSLayoutConstraint
*
contentRight
=
[
NSLayoutConstraint
constraintWithItem
:
_backImageView2
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
self
addConstraint
:
contentRight
];
NSLayoutConstraint
*
contentHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_backImageView2
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
125
];
[
self
addConstraint
:
contentHeight
];
}
return
_backImageView2
;
}
-
(
UITextView
*
)
contentTextView
{
if
(
!
_contentTextView
)
{
_contentTextView
=
[[
UITextView
alloc
]
init
];
_contentTextView
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_contentTextView
.
delegate
=
self
;
_contentTextView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
.
backImageView2
addSubview
:
_contentTextView
];
NSLayoutConstraint
*
contentTop
=
[
NSLayoutConstraint
constraintWithItem
:
_contentTextView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
backImageView2
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
1
];
[
self
.
backImageView2
addConstraint
:
contentTop
];
NSLayoutConstraint
*
contentLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_contentTextView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
backImageView2
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
1
];
[
self
.
backImageView2
addConstraint
:
contentLeft
];
NSLayoutConstraint
*
contentRight
=
[
NSLayoutConstraint
constraintWithItem
:
_contentTextView
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
backImageView2
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
1
];
[
self
.
backImageView2
addConstraint
:
contentRight
];
NSLayoutConstraint
*
contentHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_contentTextView
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
backImageView2
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:-
1
];
[
self
.
backImageView2
addConstraint
:
contentHeight
];
}
return
_contentTextView
;
}
-
(
UILabel
*
)
placeholderLabel2
{
if
(
!
_placeholderLabel2
)
{
_placeholderLabel2
=
[[
UILabel
alloc
]
init
];
_placeholderLabel2
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_placeholderLabel2
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_placeholderLabel2
.
textColor
=
kOnLineCellDetailColor
;
[
self
.
contentTextView
addSubview
:
_placeholderLabel2
];
NSLayoutConstraint
*
contentTop
=
[
NSLayoutConstraint
constraintWithItem
:
_placeholderLabel2
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentTextView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
2
];
[
self
.
contentTextView
addConstraint
:
contentTop
];
NSLayoutConstraint
*
contentLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_placeholderLabel2
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentTextView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
5
];
[
self
.
contentTextView
addConstraint
:
contentLeft
];
NSLayoutConstraint
*
contentRight
=
[
NSLayoutConstraint
constraintWithItem
:
_placeholderLabel2
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentTextView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentTextView
addConstraint
:
contentRight
];
NSLayoutConstraint
*
contentHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_placeholderLabel2
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
30
];
[
self
.
contentTextView
addConstraint
:
contentHeight
];
}
return
_placeholderLabel2
;
}
-
(
UIButton
*
)
sureBtn
{
if
(
!
_sureBtn
)
{
_sureBtn
=
[[
UIButton
alloc
]
init
];
// 设置圆角
_sureBtn
.
layer
.
cornerRadius
=
4
;
_sureBtn
.
layer
.
masksToBounds
=
YES
;
_sureBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_sureBtn
.
backgroundColor
=
kLoginButtonBackGroundColor
;
[
_sureBtn
setTitleColor
:[
UIColor
whiteColor
]
forState
:
UIControlStateNormal
];
_sureBtn
.
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
20
.
0
];
[
self
addSubview
:
_sureBtn
];
// 顶端
NSLayoutConstraint
*
loginTop
=
[
NSLayoutConstraint
constraintWithItem
:
_sureBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
backImageView2
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
20
];
[
self
addConstraint
:
loginTop
];
// 左边
NSLayoutConstraint
*
loginLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_sureBtn
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
addConstraint
:
loginLeft
];
// 右边
NSLayoutConstraint
*
loginRight
=
[
NSLayoutConstraint
constraintWithItem
:
_sureBtn
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
self
addConstraint
:
loginRight
];
// 高度
NSLayoutConstraint
*
loginHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_sureBtn
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
45
];
[
self
addConstraint
:
loginHeight
];
}
return
_sureBtn
;
}
@end
redstar/Classes/Module/Function/Question/QuestionDetail/ViewController/QuestionDetailViewController.m
View file @
0a7c0e33
...
...
@@ -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
=
.
0
f
;
_commentView
.
frame
=
fromFrame
;
}
completion
:^
(
BOOL
finished
)
{
[
_backGroundView
removeFromSuperview
];
[
_commentView
removeFromSuperview
];
}];
}
#pragma mark - UITableView Delegate/DataSource
...
...
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/ViewController/RankingListViewController.m
View file @
0a7c0e33
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment