Search code examples
layoutviewappcelerator

Appcelerator adding elements before and after specific elements


Using appcelerator, how do you go about inserting elements before and after specific elements. Such as <View id='element'>Some Content</View>

Using $.element.add() the new element will be inside it but i need it to go either before or after. In simple terms is there an equivalent to .before and.after in jQuery?

Many thanks


Solution

  • You can use the method insertAt (docs).

    If the parent view's layout is horizontal or vertial, then you'll see the children views displayed according to their array positions.