Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
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
mobile-group
galaxy-iOS
Commits
2ed3887d
Commit
2ed3887d
authored
Nov 26, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// AI
parent
a85bc54e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
YHAutoTextView.swift
galaxy/galaxy/Classes/Base/V/YHAutoTextView.swift
+7
-10
YHAIViewController.swift
...s/Modules/AI/AI-Dialogue(AI对话)/C/YHAIViewController.swift
+4
-0
YHAITextInputView.swift
...es/Modules/AI/AI-Dialogue(AI对话)/V/YHAITextInputView.swift
+2
-2
No files found.
galaxy/galaxy/Classes/Base/V/YHAutoTextView.swift
View file @
2ed3887d
...
...
@@ -33,11 +33,8 @@ class YHAutoTextView: UITextView, UITextViewDelegate {
override
init
(
frame
:
CGRect
,
textContainer
:
NSTextContainer
?)
{
super
.
init
(
frame
:
frame
,
textContainer
:
textContainer
)
//
delegate = self
delegate
=
self
isScrollEnabled
=
false
// 禁止滚动
translatesAutoresizingMaskIntoConstraints
=
false
clearsOnInsertion
=
true
self
.
addSubview
(
placeholderLabel
)
placeholderLabel
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
5
)
...
...
@@ -51,12 +48,12 @@ class YHAutoTextView: UITextView, UITextViewDelegate {
}
// UITextViewDelegate 方法
//
func textViewDidChange(_ textView: UITextView) {
//
// 更新自身的高度
//
invalidateIntrinsicContentSize()
//
placeholderLabel.isHidden = !textView.text.isEmpty
//
text = textView.text
//
}
func
textViewDidChange
(
_
textView
:
UITextView
)
{
// 更新自身的高度
invalidateIntrinsicContentSize
()
placeholderLabel
.
isHidden
=
!
textView
.
text
.
isEmpty
text
=
textView
.
text
}
override
var
intrinsicContentSize
:
CGSize
{
// 计算内容的尺寸
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/C/YHAIViewController.swift
View file @
2ed3887d
...
...
@@ -8,6 +8,7 @@
import
UIKit
import
Alamofire
import
IQKeyboardManagerSwift
class
YHAIViewController
:
YHBaseViewController
{
...
...
@@ -51,7 +52,10 @@ class YHAIViewController: YHBaseViewController {
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
IQKeyboardManager
.
shared
.
enable
=
false
gk_navTitle
=
"AI对话"
self
.
view
.
addSubview
(
self
.
tableView
)
self
.
view
.
addSubview
(
self
.
bottomInputView
)
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/V/YHAITextInputView.swift
View file @
2ed3887d
...
...
@@ -42,7 +42,7 @@ class YHAITextInputView: UIView {
}
var
textView
:
YHAutoTextView
=
{
let
v
=
YHAutoTextView
(
frame
:
.
zero
)
let
v
=
YHAutoTextView
()
v
.
font
=
.
PFSC_R
(
ofSize
:
14
)
return
v
}()
...
...
@@ -115,7 +115,7 @@ class YHAITextInputView: UIView {
let
bottomMargin
=
(
isKeyboardShow
?
-
keyboardFrame
.
height
:
0
)
self
.
snp
.
updateConstraints
{
make
in
make
.
bottom
.
equalTo
Superview
()
.
offset
(
bottomMargin
)
make
.
bottom
.
equalTo
(
bottomMargin
)
}
self
.
setNeedsLayout
()
self
.
layoutIfNeeded
()
...
...
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