Comments (7)
Hi @poolqf. Thanks for your issue. Please go ahead and open a PR 👍
from activelabel.swift.
Did you manage to fix this issue about the alignment?
from activelabel.swift.
Nope @xScylez , the only thing I fixed was horizontal alignment, but not the vertical one.
But a workaround could be to use the horizontal alignment fix, and then make the UILabel height fit to size, and then manually center the label inside the view you want
from activelabel.swift.
@poolqf Could you post an example code for your workaround please? I don't fully understand what you mean.
from activelabel.swift.
@xScylez taking #31 , that is fixing the horizontal alignment, the workaround for fixing de vertical alignment, in a really verbose way, could be something like this:
let containerView = UIView()
containerView.frame = CGRect(x: 0, y: 0, width: 150, height: 50)
let label = ActiveLabel()
label.text = "My Text"
label.textAlignment = .Center
label.sizeToFit()
let containerHeight = containerView.frame.height
label.frame = CGRect(x: 0, y: containerHeight/2 - label.frame.height/2, width: containerView.frame.width, height: label.frame.height)
containerView.addSubview(label)
It is just vertically centering the label inside the container view
from activelabel.swift.
@poolqf What about if the label is already declared as a ActiveLabel in Storyboard? I can access the label using the command imageCell.imageText
.
from activelabel.swift.
@xScylez using Storyboards it should be even easier if you play with the correct constraints
from activelabel.swift.
Related Issues (20)
- If there are the same mention, can I know which one is clicked HOT 2
- How to calculate the height of swiftui HOT 1
- Active table #tag not working for Tamil language properly HOT 1
- HTML tags not working properly HOT 1
- customeType does not work
- Email Support has not been included in the PODS
- string have mention username without space it is not working HOT 1
- configureLinkAttribute 点击后无效
- Add padding to LabelView in swiftui does not work. HOT 1
- Nn
- Tap Label outside of tags and mentions
- Label insets Issue
- How do I use a filterHashtag in swift5
- URL Link selected font
- In mention username with dot is not detecting HOT 2
- handleCustomTap not working
- In mentions(@) full user name not detected only first name is detecting HOT 2
- urls didn't get recognised by ActiveLabel
- Apple's update to their API policy - Required Reason in Privacy manifest
- 识别 url 问题: 文本中的url需要前后带空格,才能识别出来。
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from activelabel.swift.