asyncdisplaykit


AsyncDisplayKit Layout - how to enforce a maximum height (or width)


I'm trying to enforce a maximum height for an element and I can't figure out exactly which LayoutSpec can help me do that. It seems like the sizeRange property is what I would expect to work but that appears to work only with ASStaticLayoutSpec, which seems like more of a last resort option. (This element I need to constrain is contained in an ASInsetLayoutSpec in my case.)
Here's my attempt:
CGSize max = CGSizeMake(constrainedSize.max.width, [self.class maxSinglePhotoHeight]);
_singlePhotoNode.sizeRange = ASRelativeSizeRangeMake(ASRelativeSizeMakeWithCGSize(constrainedSize.min), ASRelativeSizeMakeWithCGSize(max));
ASInsetLayoutSpec *inset = [ASInsetLayoutSpec insetLayoutSpecWithInsets:PHOTO_INSET child:_singlePhotoNode];
I'm found this:
ASInsetLayoutSpec *insetLayoutSpec = [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(INFINITY, INFINITY, INFINITY, INFINITY) child:self.displayNode];
But be sure max size must not be inf in param, or u go in infinity layouts loop.

Related Links

How can I enforce a minimum Height for a ASDisplayNode?
AsyncDisplayKit Layout - how to enforce a maximum height (or width)

Categories

HOME
xml
kentico
api
gdb
jmeter
android-studio-2.2
flex
hessian
solver
appcelerator
nsbundle
big-o
3d-reconstruction
gembox-spreadsheet
appcelerator-studio
alamofire
tput
automatic-ref-counting
eip
scrolltop
symbol
libusb
altera
azure-iot-hub
dynamic-sql
asp.net-mvc-viewmodel
jersey-1.0
pyramid
symfony-console
shortest-path
sse
apache2.4
interpreter
ckfinder
windows-server-2003
stackexchange
fable-f#
android-maps
rpgle
comparable
google-cast
eviews
scatter3d
mockjax
cart
card.io
activexobject
vue-chartjs
nested-lists
alphabetical
projects-and-solutions
bc
spring-mvc-test
congestion-control
android-checkbox
xmldocument
signal-strength
stylecop
plan-9
robomongo
dotnet-httpclient
insight
corruption
azure-cli
er-diagram
reshape
type-theory
pybrain
cronexpression
grails-plugin
vulcanize
ng-grid
tooleap
yajsw
html-to-pdf
libav
nio2
httpruntime.cache
crouton-os
rewrite
include-guards
haskell-warp
airbrake
dnssec
ejb-2.x
nodelist
packet-sniffers
rmysql
ora-06550
sphinxql
cocoalibspotify-2.0
unit-of-work
gpars
poker
facebook-timeline
intersect
appjs
htdocs
lr
multiplatform
object-database
windows-identity
fdf

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App