Comments (11)
我不清楚你现在的代码怎么写的, 我举几个例子:
// 设置推荐的大小(一般为行高) 位置居中
\(.image(#imageLiteral(resourceName: "swift-icon"), .proposed(.center)))
// 设置图片原始大小 (宽度不会超过整行长度) 位置居中
\(.image(#imageLiteral(resourceName: "swift-icon"), .original(.center)))
from attributedstring.
谢谢指导,设置了proposed这个之后是不是就不能设置customsize了,这个设置是只能有一个选项吗?
from attributedstring.
对的, 都是设置尺寸.
from attributedstring.
嗯嗯,我试了一下,设置了customsize之后图片不能居中,设置.proposed(.center)图片大小就不对,这两个能不能同时设置?
from attributedstring.
custom 可以居中呀
\(.image(#imageLiteral(resourceName: "swift-icon"), .custom(.center, size: .init(width: 50, height: 50))))
from attributedstring.
草率了草率了,我再看下。感谢开源,感谢指导,谢谢。另外大佬的LEEalert可准备Swift一下,一直用你的LEEAlert很方便。再次感谢。
from attributedstring.
感谢支持 Alert的不知道啊 库再多点我可能管不过来了就.
from attributedstring.
好的,辛苦。奥利给
from attributedstring.
.custom(.center, size: .init(width: 50, height: 50))))
我用这个一样会有偏差 并没有居中 不知道为什么
from attributedstring.
图片居中取决于所在的文本font
from attributedstring.
他的规则是如何计算的呢?比如16大小的字体,10高度的图片,我需要居中如何计算
from attributedstring.
Related Issues (20)
- SPM Warning HOT 1
- Error HOT 2
- 重构Action没有兼容低版本吗?我代码之前都可以跳转,升级后点击事件没了 HOT 5
- 自定义构造 Attribute HOT 6
- 控制器的某个Label属性使用了.action 造成该控制器没有调用deinit HOT 16
- ASAttributedString如何通过range截取部分富文本? HOT 10
- ViewAttachment 能否将view开放出来 HOT 4
- 添加Action的情况下 文字颜色始终是蓝色,怎么修改呢 HOT 2
- AttributedString.swift文件中别名的问题 HOT 1
- TextView 图片偏移显示不全 HOT 2
- XCode14打包在iOS12设备上崩溃问题 HOT 5
- 挺喜欢这个库,但是使用的时候遇到了一些问题 HOT 15
- UIButton下action点击无效 HOT 1
- 点击事件崩溃 HOT 3
- iOS16 UITextView 默认使用的TextKit2 如遇到问题 可以切换到 TextKit 1
- 如何在SwiftUI中使用? HOT 1
- 根据多个Range设置字体颜色时,只有最后一个生效 HOT 3
- Build error with Objective-C project HOT 1
- How to create from HTML? HOT 1
- UITextView 如果设置了 isSelectable = false HOT 1
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 attributedstring.