We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
现在好像都在
The text was updated successfully, but these errors were encountered:
额,不要慌,这是我在 demo 里偷懒了……
这里就是计算高度的 protocol 方法,在这里返回根据模型计算得到的高度即可,Tangram 会通过这个借口取高度。
Sorry, something went wrong.
弱弱的问下,在(CGFloat)heightByModel:(TangramDefaultItemModel *)itemModel; { return 100.f; } 这里面怎么根据模型算高度?如果我想直接根据imageview的image的高度来计算,这里面怎么写?类方法里不是不能用实例变量吗?
如果要根据image的高度来动态计算,的确会比较难受。
阿里CDN的图片地址都是带宽高比的,例如 https://img.alicdn.com/tfs/TB1JIM.klfH8KJjy1XbXXbLdXXa-167-70.jpg ,我们就可以根据 URL 里的宽高比来计算。
如果你们的图片是宽高比不固定,URL 还不带尺寸,建议方案:
即 {imgUrl : "xxx"} => {img : {url : "xxx", width : 100, height : 100}}
预加载图片获得宽高比。
固定图片宽高比。
No branches or pull requests
现在好像都在
{
return 100.f;
}
这里面写死高度?
The text was updated successfully, but these errors were encountered: