本文整理汇总了Java中org.appcelerator.titanium.view.TiCompositeLayout类的典型用法代码示例。如果您正苦于以下问题:Java TiCompositeLayout类的具体用法?Java TiCompositeLayout怎么用?Java TiCompositeLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TiCompositeLayout类属于org.appcelerator.titanium.view包,在下文中一共展示了TiCompositeLayout类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ExampleView
import org.appcelerator.titanium.view.TiCompositeLayout; //导入依赖的package包/类
public ExampleView(TiViewProxy proxy) {
super(proxy);
LayoutArrangement arrangement = LayoutArrangement.DEFAULT;
if (proxy.hasProperty(TiC.PROPERTY_LAYOUT)) {
String layoutProperty = TiConvert.toString(proxy.getProperty(TiC.PROPERTY_LAYOUT));
if (layoutProperty.equals(TiC.LAYOUT_HORIZONTAL)) {
arrangement = LayoutArrangement.HORIZONTAL;
} else if (layoutProperty.equals(TiC.LAYOUT_VERTICAL)) {
arrangement = LayoutArrangement.VERTICAL;
}
}
setNativeView(new TiCompositeLayout(proxy.getActivity(), arrangement));
}
示例2: generateCellContent
import org.appcelerator.titanium.view.TiCompositeLayout; //导入依赖的package包/类
/**
* This method creates a new cell and fill it with content. getView() calls this method
* when a view needs to be created.
* @param index Entry's index relative to its section
* @return
*/
public void generateCellContent(int sectionIndex, KrollDict data, CollectionViewTemplate template, BaseCollectionViewItem itemContent, int itemPosition, View item_layout) {
//Here we create an item content and populate it with data
//Get item proxy
TiViewProxy itemProxy = template.getRootItem().getViewProxy();
//Create corresponding TiUIView for item proxy
CollectionItem item = new CollectionItem(itemProxy, (TiCompositeLayout.LayoutParams)itemContent.getLayoutParams(), itemContent, item_layout);
//Connect native view with TiUIView so we can get it from recycled view.
itemContent.setTag(item);
if (data != null && template != null) {
generateChildContentViews(template.getRootItem(), null, itemContent, true);
populateViews(data, itemContent, template, itemPosition, sectionIndex, item_layout);
}
}
示例3: replaceCenterView
import org.appcelerator.titanium.view.TiCompositeLayout; //导入依赖的package包/类
/**
* centerView
*/
public void replaceCenterView(TiViewProxy viewProxy) {
if (viewProxy == this.centerView) {
Log.d(TAG, "centerView was not changed");
return;
}
if (viewProxy == null) {
return;
}
viewProxy.setActivity(proxy.getActivity());
TiUIView contentView = getOrCreateView(viewProxy);
View view = contentView.getOuterView();
TiCompositeLayout fL = (TiCompositeLayout)getNativeView().findViewById(id_content_frame);
ViewParent viewParent = view.getParent();
if (viewParent == null) {
fL.addView(view, contentView.getLayoutParams());
}
if (viewParent instanceof ViewGroup && viewParent != fL) {
((ViewGroup)viewParent).removeView(view);
fL.addView(view, contentView.getLayoutParams());
}
if (this.centerView != null) {
fL.removeView(getOrCreateView(this.centerView).getNativeView());
this.centerView.releaseViews();
}
this.centerView = viewProxy;
}