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
d0792c43
Commit
d0792c43
authored
Dec 12, 2015
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复添加新问题 可以拍照或选择本地图片
parent
7fbcb01a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
15 deletions
+35
-15
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
AddQuestionViewController.m
...on/AddQuestion/ViewController/AddQuestionViewController.m
+33
-13
QuestionViewController.m
...tion/QuestionList/ViewController/QuestionViewController.m
+1
-1
HomeViewController.m
...r/Classes/Module/Home/ViewController/HomeViewController.m
+1
-1
No files found.
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
d0792c43
No preview for this file type
redstar/Classes/Module/Function/Question/AddQuestion/ViewController/AddQuestionViewController.m
View file @
d0792c43
...
...
@@ -39,6 +39,8 @@
@property
(
nonatomic
,
strong
)
UIActionSheet
*
categoryActionSheet
;
@property
(
nonatomic
,
strong
)
UIActionSheet
*
questionActionSheet
;
@property
(
nonatomic
,
strong
)
UIActionSheet
*
selectActionSheet
;
@property
(
nonatomic
,
strong
)
UILabel
*
selectLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
selectLabel1
;
@property
(
nonatomic
,
assign
)
int
rowNumber
;
...
...
@@ -135,21 +137,15 @@
-
(
void
)
createImagePicker
:
(
UIButton
*
)
sender
{
self
.
selectActionSheet
=
[[
UIActionSheet
alloc
]
initWithTitle
:
nil
delegate
:
self
cancelButtonTitle
:
@"取消"
destructiveButtonTitle
:
nil
otherButtonTitles
:
@"直接拍照上传"
,
@"从本地相册选择"
,
nil
];
_selectActionSheet
.
delegate
=
self
;
_selectActionSheet
.
tag
=
999283
;
[
_selectActionSheet
showInView
:
self
.
view
];
if
(
sender
.
tag
==
2201
)
{
_rowNumber
++
;
}
if
(
!
[
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypeCamera
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
nil
message
:
@"找不到相机"
delegate
:
nil
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
[
alert
show
];
}
else
{
UIImagePickerController
*
picker
=
[[
UIImagePickerController
alloc
]
init
];
picker
.
delegate
=
self
;
picker
.
sourceType
=
UIImagePickerControllerSourceTypeCamera
;
picker
.
modalTransitionStyle
=
UIModalTransitionStyleFlipHorizontal
;
picker
.
videoQuality
=
UIImagePickerControllerQualityTypeLow
;
[
self
presentViewController
:
picker
animated
:
YES
completion
:
nil
];
}
}
...
...
@@ -512,13 +508,37 @@
-
(
void
)
actionSheet
:
(
UIActionSheet
*
)
actionSheet
didDismissWithButtonIndex
:
(
NSInteger
)
buttonIndex
{
if
(
actionSheet
.
tag
==
999283
)
{
if
(
buttonIndex
==
0
)
{
if
(
!
[
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypeCamera
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
nil
message
:
@"找不到相机"
delegate
:
nil
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
[
alert
show
];
}
else
{
UIImagePickerController
*
picker
=
[[
UIImagePickerController
alloc
]
init
];
picker
.
delegate
=
self
;
picker
.
sourceType
=
UIImagePickerControllerSourceTypeCamera
;
picker
.
modalTransitionStyle
=
UIModalTransitionStyleFlipHorizontal
;
picker
.
videoQuality
=
UIImagePickerControllerQualityTypeLow
;
[
self
presentViewController
:
picker
animated
:
YES
completion
:
nil
];
}
}
else
if
(
buttonIndex
==
1
){
UIImagePickerController
*
picker
=
[[
UIImagePickerController
alloc
]
init
];
picker
.
sourceType
=
UIImagePickerControllerSourceTypePhotoLibrary
;
picker
.
delegate
=
self
;
//设置选择后的图片可被编辑
picker
.
allowsEditing
=
YES
;
[
self
presentViewController
:
picker
animated
:
YES
completion
:
nil
];
}
}
if
(
actionSheet
==
_categoryActionSheet
)
{
if
(
buttonIndex
<
[
NSArray
arrayWithObjects
:
CATEGORYLIST
].
count
)
{
_selectLabel
.
text
=
[[
NSArray
arrayWithObjects
:
CATEGORYLIST
]
objectAtIndex
:
buttonIndex
];
[
_saveDict
setObject
:[[
NSArray
arrayWithObjects
:
CATEGORYLIST
]
objectAtIndex
:
buttonIndex
]
forKey
:
@"selectLabel"
];
}
}
else
{
}
else
if
(
actionSheet
==
_questionActionSheet
)
{
if
(
buttonIndex
<
[
NSArray
arrayWithObjects
:
QUESTIONLIST
].
count
)
{
_selectLabel1
.
text
=
[[
NSArray
arrayWithObjects
:
QUESTIONLIST
]
objectAtIndex
:
buttonIndex
];
[
_saveDict
setObject
:[[
NSArray
arrayWithObjects
:
QUESTIONLIST
]
objectAtIndex
:
buttonIndex
]
forKey
:
@"selectLabel1"
];
...
...
redstar/Classes/Module/Function/Question/QuestionList/ViewController/QuestionViewController.m
View file @
d0792c43
...
...
@@ -112,7 +112,7 @@
NSDictionary
*
parameters
=
@{
@"user"
:
user_uuid
,
@"scope"
:
@"all"
,
@"pageNumber"
:
@
(
0
),
@"pageSize"
:
@
(
1
0
)
@"pageSize"
:
@
(
2
0
)
};
// 发起请求
...
...
redstar/Classes/Module/Home/ViewController/HomeViewController.m
View file @
d0792c43
...
...
@@ -368,7 +368,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSDictionary
*
parameters
=
@{
@"user"
:
user_uuid
,
@"scope"
:
@"all"
,
@"pageNumber"
:
@
(
0
),
@"pageSize"
:
@
(
2
)
@"pageSize"
:
@
(
10
)
};
// 发起请求
...
...
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