本文整理汇总了Java中org.appcelerator.titanium.proxy.TiViewProxy.hasProperty方法的典型用法代码示例。如果您正苦于以下问题:Java TiViewProxy.hasProperty方法的具体用法?Java TiViewProxy.hasProperty怎么用?Java TiViewProxy.hasProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.appcelerator.titanium.proxy.TiViewProxy
的用法示例。
在下文中一共展示了TiViewProxy.hasProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ExampleView
import org.appcelerator.titanium.proxy.TiViewProxy; //导入方法依赖的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: addSearchLayout
import org.appcelerator.titanium.proxy.TiViewProxy; //导入方法依赖的package包/类
private void addSearchLayout(RelativeLayout layout, TiViewProxy searchView, TiUIView search) {
RelativeLayout.LayoutParams p = createBasicSearchLayout();
p.addRule(RelativeLayout.ALIGN_PARENT_TOP);
TiDimension rawHeight;
if (searchView.hasProperty(TiC.PROPERTY_HEIGHT)) {
rawHeight = TiConvert.toTiDimension(searchView.getProperty(TiC.PROPERTY_HEIGHT), 0);
} else {
rawHeight = TiConvert.toTiDimension(MIN_SEARCH_HEIGHT, 0);
}
p.height = rawHeight.getAsPixels(layout);
View nativeView = search.getNativeView();
layout.addView(nativeView, p);
p = createBasicSearchLayout();
p.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
p.addRule(RelativeLayout.BELOW, nativeView.getId());
ViewParent parentWrapper = wrapper.getParent();
if (parentWrapper != null && parentWrapper instanceof ViewGroup) {
//get the previous layout params so we can reset with new layout
ViewGroup.LayoutParams lp = wrapper.getLayoutParams();
ViewGroup parentView = (ViewGroup) parentWrapper;
//remove view from parent
parentView.removeView(wrapper);
//add new layout
layout.addView(wrapper, p);
parentView.addView(layout, lp);
} else {
layout.addView(wrapper, p);
}
this.searchLayout = layout;
}