Giter Site home page Giter Site logo

Comments (11)

lixiang1994 avatar lixiang1994 commented on May 18, 2024

我不清楚你现在的代码怎么写的, 我举几个例子:

// 设置推荐的大小(一般为行高) 位置居中
\(.image(#imageLiteral(resourceName: "swift-icon"), .proposed(.center)))

// 设置图片原始大小 (宽度不会超过整行长度) 位置居中
\(.image(#imageLiteral(resourceName: "swift-icon"), .original(.center)))

from attributedstring.

simpleLiYu avatar simpleLiYu commented on May 18, 2024

谢谢指导,设置了proposed这个之后是不是就不能设置customsize了,这个设置是只能有一个选项吗?

from attributedstring.

lixiang1994 avatar lixiang1994 commented on May 18, 2024

对的, 都是设置尺寸.

from attributedstring.

simpleLiYu avatar simpleLiYu commented on May 18, 2024

嗯嗯,我试了一下,设置了customsize之后图片不能居中,设置.proposed(.center)图片大小就不对,这两个能不能同时设置?

from attributedstring.

lixiang1994 avatar lixiang1994 commented on May 18, 2024

custom 可以居中呀

 \(.image(#imageLiteral(resourceName: "swift-icon"), .custom(.center, size: .init(width: 50, height: 50))))

from attributedstring.

simpleLiYu avatar simpleLiYu commented on May 18, 2024

草率了草率了,我再看下。感谢开源,感谢指导,谢谢。另外大佬的LEEalert可准备Swift一下,一直用你的LEEAlert很方便。再次感谢。

from attributedstring.

lixiang1994 avatar lixiang1994 commented on May 18, 2024

感谢支持 Alert的不知道啊 库再多点我可能管不过来了就.

from attributedstring.

simpleLiYu avatar simpleLiYu commented on May 18, 2024

好的,辛苦。奥利给

from attributedstring.

China-jxsg-YanYuanJie avatar China-jxsg-YanYuanJie commented on May 18, 2024

.custom(.center, size: .init(width: 50, height: 50))))
我用这个一样会有偏差 并没有居中 不知道为什么

from attributedstring.

lixiang1994 avatar lixiang1994 commented on May 18, 2024

图片居中取决于所在的文本font

from attributedstring.

China-jxsg-YanYuanJie avatar China-jxsg-YanYuanJie commented on May 18, 2024

他的规则是如何计算的呢?比如16大小的字体,10高度的图片,我需要居中如何计算

from attributedstring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.