當前位置: 首頁>>代碼示例>>Java>>正文


Java RelativeLayout.addView方法代碼示例

本文整理匯總了Java中android.widget.RelativeLayout.addView方法的典型用法代碼示例。如果您正苦於以下問題:Java RelativeLayout.addView方法的具體用法?Java RelativeLayout.addView怎麽用?Java RelativeLayout.addView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.RelativeLayout的用法示例。


在下文中一共展示了RelativeLayout.addView方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getView

import android.widget.RelativeLayout; //導入方法依賴的package包/類
@Override
		public View getView(int position, View convertView, ViewGroup parent) {
			
			RelativeLayout layoutView = new RelativeLayout(context);
			TextView textView = new TextView(context);
			textView.setTextSize(13);
			textView.setText(itemList.get(position));
			
			textView.setTag(position);
			
			if (checkedPosition == position || itemList.size() == 1) {
//				layoutView.setBackgroundColor(0x8033B5E5);
				textView.setTextColor(context.getResources().getColor(R.color.rb_text_check));
			} else {
				textView.setTextColor(Color.WHITE);
			}
			
			LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
			params.addRule(RelativeLayout.CENTER_IN_PARENT);
			layoutView.addView(textView, params);
			layoutView.setMinimumHeight(ParamsUtil.dpToPx(context, 26));
			return layoutView;

		}
 
開發者ID:lbbniu,項目名稱:CCDownload,代碼行數:25,代碼來源:PopMenu.java

示例2: initLayout

import android.widget.RelativeLayout; //導入方法依賴的package包/類
public RelativeLayout initLayout() {
    View v = getLayoutInflater(null).inflate(R.layout.apprunner_fragment, null);

    // add main layout
    mainLayout = (RelativeLayout) v.findViewById(R.id.main);

    // set the parent
    parentScriptedLayout = (RelativeLayout) v.findViewById(R.id.scriptedLayout);

    liveCoding = new PLiveCodingFeedback(mContext);
    mainLayout.addView(liveCoding.add());

    infoLayout = (RelativeLayout) v.findViewById(R.id.infoLayout);
    txtTitle = (TextView) v.findViewById(R.id.txtTitle);
    txtSubtitle = (TextView) v.findViewById(R.id.txtSubtitle);

    return mainLayout;
}
 
開發者ID:victordiaz,項目名稱:phonk,代碼行數:19,代碼來源:AppRunnerFragment.java

示例3: initWidgets

import android.widget.RelativeLayout; //導入方法依賴的package包/類
@Override
protected void initWidgets() {
    super.initWidgets();
    mLayoutBottom = (RelativeLayout) findViewById(R.id.kf5_bottom_layout);
    mFeedBackDetailBottomView = new FeedBackDetailBottomView(mActivity);
    mFeedBackDetailBottomView.setListener(this);
    mETContent = layoutListener.getEditText();
    mLayoutBottom.addView(mFeedBackDetailBottomView);
    mListView = (ListView) findViewById(R.id.kf5_activity_feed_back_details_listview);
    mListView.setOnScrollListener(this);
    mListView.setOnItemLongClickListener(this);
    mListView.addHeaderView(inflateHeaderView());
    mBackImg = (ImageView) findViewById(R.id.kf5_return_img);
    mBackImg.setOnClickListener(this);
    mRightView = (TextView) findViewById(R.id.kf5_right_text_view);
    mRightView.setOnClickListener(this);
}
 
開發者ID:Zyj163,項目名稱:yyox,代碼行數:18,代碼來源:FeedBackDetailsActivity.java

示例4: initView

import android.widget.RelativeLayout; //導入方法依賴的package包/類
private void initView() {
//        //動態添加webview,防止webview內存泄露
        RelativeLayout layout_content= (RelativeLayout) findViewById(R.id.layout_content);
        webView=new WebView(this);
        webView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        layout_content.addView(webView);
//        webView = (WebView) findViewById(R.id.webView);

        layout_no_data = (RelativeLayout) findViewById(R.id.layout_no_data);
        top_bar = (LinearLayout) findViewById(R.id.top_bar);
        left_btn = (ImageView) findViewById(R.id.left_btn);
        middleTitle = (TextView) findViewById(R.id.middleTitle);
        rightBtn = (ImageView) findViewById(R.id.right_home_btn);
        rightShareButton = (ImageView) findViewById(R.id.right_share_btn);

        //設置webview相關設置
        initWebView(webView);
        //設置webview相關事件
        initWebEvent(webView);
    }
 
開發者ID:AlpacaNotSheep,項目名稱:hybrid,代碼行數:21,代碼來源:BaseWebActivity.java

示例5: updateIndicator

import android.widget.RelativeLayout; //導入方法依賴的package包/類
public void updateIndicator(int count) {
    if(dotViews == null){
        return;
    }
    for(int i = 0 ; i < dotViews.size() ; i++){
        if(i >= count){
            dotViews.get(i).setVisibility(GONE);
            ((View)dotViews.get(i).getParent()).setVisibility(GONE);
        }
        else {
            dotViews.get(i).setVisibility(VISIBLE);
            ((View)dotViews.get(i).getParent()).setVisibility(VISIBLE);
        }
    }
    if(count > dotViews.size()){
        int diff = count - dotViews.size();
        for(int i = 0 ; i < diff ; i++){
            RelativeLayout rl = new RelativeLayout(context);
            LayoutParams params = new LinearLayout.LayoutParams(dotHeight,dotHeight);
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
            layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
            ImageView imageView = new ImageView(context);
            imageView.setImageBitmap(unselectedBitmap);
            rl.addView(imageView, layoutParams);
            rl.setVisibility(View.GONE);
            imageView.setVisibility(View.GONE);
            this.addView(rl, params);
            dotViews.add(imageView);
        }
    }
}
 
開發者ID:turoDog,項目名稱:KTalk,代碼行數:32,代碼來源:EaseEmojiconIndicatorView.java

示例6: DProgressBar

import android.widget.RelativeLayout; //導入方法依賴的package包/類
public static ProgressBar DProgressBar(Context context) {

        ViewGroup layout = (ViewGroup) ((Activity) context).findViewById(android.R.id.content).getRootView();
        ProgressBar mProgressBar = new ProgressBar(context, null, android.R.attr.progressBarStyleLarge);
        mProgressBar.setIndeterminate(true);
        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
        RelativeLayout rl = new RelativeLayout(context);
        rl.setGravity(Gravity.CENTER);
        rl.addView(mProgressBar);
        layout.addView(rl, params);
        return mProgressBar;
    }
 
開發者ID:derohimat,項目名稱:SgPSI,代碼行數:13,代碼來源:DialogFactory.java

示例7: onCreate

import android.widget.RelativeLayout; //導入方法依賴的package包/類
public void onCreate() {
	super.onCreate();

	int screenHeight = ResHelper.getScreenHeight(activity);
	float ratio = ((float) screenHeight) / DESIGN_SCREEN_HEIGHT;

	maxBodyHeight = 0;

	llPage = new LinearLayout(activity);
	llPage.setOrientation(LinearLayout.VERTICAL);
	activity.setContentView(llPage);

	rlTitle = new RelativeLayout(activity);
	rlTitle.setBackgroundColor(0xffe6e9ec);
	int titleHeight = (int) (DESIGN_TITLE_HEIGHT * ratio);

	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, titleHeight);
	llPage.addView(rlTitle, lp);
	initTitle(rlTitle, ratio);

	RelativeLayout rlBody = new RelativeLayout(activity);
	rlBody.setBackgroundColor(0xffffffff);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPage.addView(rlBody, lp);
	initBody(rlBody, ratio);

	LinearLayout llShadow = new LinearLayout(activity);
	llShadow.setOrientation(LinearLayout.VERTICAL);
	rlBody.addView(llShadow, new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
	initShadow(llShadow, ratio);

	llBottom = new LinearLayout(activity);
	llBottom.setOrientation(LinearLayout.VERTICAL);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPage.addView(llBottom, lp);
	initBottom(llBottom, ratio);
}
 
開發者ID:Zyj163,項目名稱:yyox,代碼行數:38,代碼來源:EditPagePort.java

示例8: setupIndicator

import android.widget.RelativeLayout; //導入方法依賴的package包/類
public void setupIndicator(RelativeLayout indicator) {
    this.indicator = indicator;
    if (indicator == null) {
        return;
    }
    if (indicator.getChildCount() > 0) {
        indicator.removeAllViews();
    }
    ringList = new ArrayList<ImageView>();
    RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    lp.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
    LinearLayout ll = new LinearLayout(context);
    ll.setLayoutParams(lp);
    indicator.addView(ll);
    LinearLayout.LayoutParams lpp = new LinearLayout.LayoutParams(DisplayUtil.dp2px(7), DisplayUtil.dp2px(7));
    for (int i = 0; i < pageCount; i++) {
        ImageView iv = new ImageView(context);
        iv.setLayoutParams(lpp);
        if (pageCount == 1) {
            iv.setBackgroundResource(R.drawable.ring_imageview_select);
        }
        if (i > 0) {
            lpp.leftMargin = DisplayUtil.dp2px(3);
        }
        ringList.add(iv);
        ll.addView(iv);
    }
}
 
開發者ID:wzc25151,項目名稱:lrs_android,代碼行數:29,代碼來源:AutoScrollViewPager.java

示例9: onCreateView

import android.widget.RelativeLayout; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
    final RelativeLayout view = (RelativeLayout) inflater.inflate(R.layout.map_google, container, false);
    registerListeners(view);
    if (! myLocationEnabled)
        view.findViewById(R.id.mapLocateButton).setVisibility(View.INVISIBLE);
    
    final int errorCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getActivity());
    if (errorCode != ConnectionResult.SUCCESS)
    {
        final Dialog errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode, getActivity(), 0);
        errorDialog.show();
        getFragmentManager().popBackStack();
        return view;
    }
    
    View mapView = super.onCreateView(inflater, container, savedInstanceState);
    
    final RelativeLayout mapViewContainer = (RelativeLayout) view.findViewById(R.id.mapViewContainer);
    mapViewContainer.addView(mapView);
    
    
    ProgressBar progessBar = new ProgressBar(getActivity());
    final RelativeLayout.LayoutParams layoutParams =
            new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
            RelativeLayout.LayoutParams.WRAP_CONTENT);
    layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, 1);
    progessBar.setLayoutParams(layoutParams);
    progessBar.setVisibility(View.GONE);
    view.addView(progessBar);
    
    
    return view;
}
 
開發者ID:rtr-nettest,項目名稱:open-rmbt,代碼行數:36,代碼來源:RMBTMapFragment.java

示例10: initView

import android.widget.RelativeLayout; //導入方法依賴的package包/類
private void initView() {
    RelativeLayout layout = new RelativeLayout(mContext);
    RelativeLayout.LayoutParams params =
            new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
                    RelativeLayout.LayoutParams.WRAP_CONTENT);
    params.addRule(RelativeLayout.CENTER_HORIZONTAL);
    params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);

    mGood = new TextView(mContext);
    mGood.setIncludeFontPadding(false);
    mGood.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mTextSize);
    mGood.setTextColor(ContextCompat.getColor(mContext, mTextColor));
    mGood.setText(mText);
    mGood.setLayoutParams(params);
    layout.addView(mGood);
    setContentView(layout);

    int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
    int h = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
    mGood.measure(w, h);
    setWidth(mGood.getMeasuredWidth());
    setHeight(mDistance + mGood.getMeasuredHeight());
    setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    setFocusable(false);
    setTouchable(false);
    setOutsideTouchable(false);

    mAnimationSet = createAnimation();
}
 
開發者ID:wp521,項目名稱:MyFire,代碼行數:30,代碼來源:GoodView.java

示例11: myAddView

import android.widget.RelativeLayout; //導入方法依賴的package包/類
private void myAddView(View view) {
    if (view instanceof FImageView && ((FImageView) view).centered) {
        // TODO: 17-2-13 any more efficient way?
        RelativeLayout rl = new RelativeLayout(mContext);
        RelativeLayout.LayoutParams rlLp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        rlLp.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
        rl.addView(view);
        rl.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
        addView(rl);
    } else {
        addView(view);
    }
}
 
開發者ID:daquexian,項目名稱:FlexibleRichTextView,代碼行數:14,代碼來源:FlexibleRichTextView.java

示例12: initBody

import android.widget.RelativeLayout; //導入方法依賴的package包/類
private void initBody(RelativeLayout rlBody, float ratio) {
	svContent = new ScrollView(activity);
	rlBody.addView(svContent, new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));

	LinearLayout llContent = new LinearLayout(activity);
	llContent.setOrientation(LinearLayout.VERTICAL);
	svContent.addView(llContent, new ScrollView.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));

	etContent = new EditText(activity);
	int padding = (int) (DESIGN_LEFT_PADDING * ratio);
	etContent.setPadding(padding, padding, padding, padding);
	etContent.setBackgroundDrawable(null);
	etContent.setTextColor(0xff3b3b3b);
	etContent.setTextSize(TypedValue.COMPLEX_UNIT_SP, 21);
	etContent.setText(sp.getText());
	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llContent.addView(etContent, lp);
	etContent.addTextChangedListener(this);

	rlThumb = new RelativeLayout(activity);
	rlThumb.setBackgroundColor(0xff313131);
	int	thumbWidth = (int) (DESIGN_THUMB_HEIGHT * ratio);
	int	xWidth = (int) (DESIGN_REMOVE_THUMB_HEIGHT * ratio);
	lp = new LinearLayout.LayoutParams(thumbWidth, thumbWidth);
	lp.leftMargin = lp.rightMargin = lp.bottomMargin = lp.topMargin = padding;
	llContent.addView(rlThumb, lp);

	aivThumb = new AsyncImageView(activity) {
		public void onImageGot(String url, Bitmap bm) {
			thumb = bm;
			super.onImageGot(url, bm);
		}
	};
	aivThumb.setScaleToCropCenter(true);
	RelativeLayout.LayoutParams rllp = new RelativeLayout.LayoutParams(thumbWidth, thumbWidth);
	rlThumb.addView(aivThumb, rllp);
	aivThumb.setOnClickListener(this);
	initThumb(aivThumb);

	xvRemove = new XView(activity);
	xvRemove.setRatio(ratio);
	rllp = new RelativeLayout.LayoutParams(xWidth, xWidth);
	rllp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
	rllp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
	rlThumb.addView(xvRemove, rllp);
	xvRemove.setOnClickListener(this);
}
 
開發者ID:lo625090140,項目名稱:lqrwechatrongcloud,代碼行數:48,代碼來源:EditPagePort.java

示例13: initTitle

import android.widget.RelativeLayout; //導入方法依賴的package包/類
private void initTitle(RelativeLayout rlTitle, float ratio) {
	tvCancel = new TextView(activity);
	tvCancel.setTextColor(0xff3b3b3b);
	tvCancel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
	tvCancel.setGravity(Gravity.CENTER);
	int resId = ResHelper.getStringRes(activity, "ssdk_oks_cancel");
	if (resId > 0) {
		tvCancel.setText(resId);
	}
	int padding = (int) (DESIGN_LEFT_PADDING * ratio);
	tvCancel.setPadding(padding, 0, padding, 0);
	RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
	rlTitle.addView(tvCancel, lp);
	tvCancel.setOnClickListener(this);

	TextView tvTitle = new TextView(activity);
	tvTitle.setTextColor(0xff3b3b3b);
	tvTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22);
	tvTitle.setGravity(Gravity.CENTER);
	resId = ResHelper.getStringRes(activity, "ssdk_oks_multi_share");
	if (resId > 0) {
		tvTitle.setText(resId);
	}
	lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
	lp.addRule(RelativeLayout.CENTER_IN_PARENT);
	rlTitle.addView(tvTitle, lp);

	tvShare = new TextView(activity);
	tvShare.setTextColor(0xffff6d11);
	tvShare.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
	tvShare.setGravity(Gravity.CENTER);
	resId = ResHelper.getStringRes(activity, "ssdk_oks_share");
	if (resId > 0) {
		tvShare.setText(resId);
	}
	tvShare.setPadding(padding, 0, padding, 0);
	lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
	lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
	rlTitle.addView(tvShare, lp);
	tvShare.setOnClickListener(this);
}
 
開發者ID:gaolhjy,項目名稱:cniao5,代碼行數:42,代碼來源:EditPageLand.java

示例14: initTitle

import android.widget.RelativeLayout; //導入方法依賴的package包/類
private void initTitle(RelativeLayout rlTitle, float ratio) {
	tvCancel = new TextView(activity);
	tvCancel.setTextColor(0xff3b3b3b);
	tvCancel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
	tvCancel.setGravity(Gravity.CENTER);
	int resId = ResHelper.getStringRes(activity, "ssdk_oks_cancel");
	if (resId > 0) {
		tvCancel.setText(resId);
	}
	int padding = (int) (DESIGN_LEFT_PADDING * ratio);
	tvCancel.setPadding(padding, 0, padding, 0);
	RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
	rlTitle.addView(tvCancel, lp);
	tvCancel.setOnClickListener(this);

	TextView tvTitle = new TextView(activity);
	tvTitle.setTextColor(0xff3b3b3b);
	tvTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22);
	tvTitle.setGravity(Gravity.CENTER);
	resId = ResHelper.getStringRes(activity, "ssdk_oks_contacts");
	if (resId > 0) {
		tvTitle.setText(resId);
	}
	lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
	lp.addRule(RelativeLayout.CENTER_IN_PARENT);
	rlTitle.addView(tvTitle, lp);

	tvConfirm = new TextView(activity);
	tvConfirm.setTextColor(0xffff6d11);
	tvConfirm.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
	tvConfirm.setGravity(Gravity.CENTER);
	resId = ResHelper.getStringRes(activity, "ssdk_oks_confirm");
	if (resId > 0) {
		tvConfirm.setText(resId);
	}
	tvConfirm.setPadding(padding, 0, padding, 0);
	lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
	lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
	rlTitle.addView(tvConfirm, lp);
	tvConfirm.setOnClickListener(this);
}
 
開發者ID:Zyj163,項目名稱:yyox,代碼行數:42,代碼來源:FriendListPage.java

示例15: initBody

import android.widget.RelativeLayout; //導入方法依賴的package包/類
private void initBody(RelativeLayout rlBody, float ratio) {
	svContent = new ScrollView(activity);
	rlBody.addView(svContent, new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));

	LinearLayout llContent = new LinearLayout(activity);
	llContent.setOrientation(LinearLayout.HORIZONTAL);
	svContent.addView(llContent, new ScrollView.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));

	etContent = new EditText(activity);
	int padding = (int) (DESIGN_LEFT_PADDING * ratio);
	etContent.setPadding(padding, padding, padding, padding);
	etContent.setBackgroundDrawable(null);
	etContent.setTextColor(0xff3b3b3b);
	etContent.setTextSize(TypedValue.COMPLEX_UNIT_SP, 21);
	etContent.setText(sp.getText());
	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(0, LayoutParams.WRAP_CONTENT);
	lp.weight = 1;
	llContent.addView(etContent, lp);
	etContent.addTextChangedListener(this);

	rlThumb = new RelativeLayout(activity);
	rlThumb.setBackgroundColor(0xff313131);
	int	thumbWidth = (int) (DESIGN_THUMB_HEIGHT_L * ratio);
	int	xWidth = (int) (DESIGN_REMOVE_THUMB_HEIGHT_L * ratio);
	lp = new LinearLayout.LayoutParams(thumbWidth, thumbWidth);
	lp.rightMargin = lp.bottomMargin = lp.topMargin = padding;
	llContent.addView(rlThumb, lp);

	aivThumb = new AsyncImageView(activity) {
		public void onImageGot(String url, Bitmap bm) {
			thumb = bm;
			super.onImageGot(url, bm);
		}
	};
	aivThumb.setScaleToCropCenter(true);
	RelativeLayout.LayoutParams rllp = new RelativeLayout.LayoutParams(thumbWidth, thumbWidth);
	rlThumb.addView(aivThumb, rllp);
	aivThumb.setOnClickListener(this);
	initThumb(aivThumb);

	xvRemove = new XView(activity);
	xvRemove.setRatio(ratio);
	rllp = new RelativeLayout.LayoutParams(xWidth, xWidth);
	rllp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
	rllp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
	rlThumb.addView(xvRemove, rllp);
	xvRemove.setOnClickListener(this);
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:49,代碼來源:EditPageLand.java


注:本文中的android.widget.RelativeLayout.addView方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。