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


Java LinearLayout.setMinimumHeight方法代碼示例

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


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

示例1: onCreateView

import android.widget.LinearLayout; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);

    // Set the text view as the activity layout
    View view =  inflater.inflate(R.layout.fragment_feedback, container, false);
    this.view = view;

    FloatingActionButton sendButton = view.findViewById(R.id.floating_button_send_feedback);
    sendButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            sendMessage();
        }
    });

    LinearLayout linearLayout = view.findViewById(R.id.linearlayout_desc);
    linearLayout.setMinimumHeight((int) (1.6*((double) view.getResources().getDimension(R.dimen.abc_action_bar_default_height_material))));

    return view;
}
 
開發者ID:medialab-prado,項目名稱:puremadrid,代碼行數:23,代碼來源:FeedbackFragment.java

示例2: createToastView

import android.widget.LinearLayout; //導入方法依賴的package包/類
private static View createToastView(Context context) {
        RelativeLayout root = new RelativeLayout(context);
        root.setTag("root");
        if (isSupport()) {
            root.setBackgroundResource(context.getResources().getIdentifier("colorAccent", "color", context.getPackageName()));
        }
        //root.setBackgroundColor(Color.RED);
        WindowManager.LayoutParams rootParams = new WindowManager.LayoutParams(-1, -2);
        rootParams.gravity = Gravity.TOP;
        root.setLayoutParams(rootParams);

        LinearLayout layout = new LinearLayout(context);
        layout.setOrientation(LinearLayout.HORIZONTAL);
        if (isSupport()) {
            layout.setBackgroundResource(context.getResources().getIdentifier("colorAccent", "color", context.getPackageName()));
        }
//        layout.setBackgroundResource(android.R.color.holo_red_dark);
//        layout.setVerticalGravity(Gravity.VERTICAL_GRAVITY_MASK);
        final RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(-2, -2);
        params.addRule(RelativeLayout.CENTER_IN_PARENT);
        layout.setLayoutParams(params);
        layout.setMinimumHeight(getMinHeight(context));

        ImageView imageView = new ImageView(context);
        imageView.setTag("image");
        imageView.setVisibility(View.GONE);

        TextView textView = new TextView(context);
        textView.setTag("text");
        textView.setTextColor(Color.WHITE);

        final LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
        layoutParams.setMargins(getMinHeight(context, 10), 0, 0, 0);
        layoutParams.gravity = Gravity.CENTER_VERTICAL;

        layout.addView(imageView, layoutParams);
        layout.addView(textView, layoutParams);
        root.addView(layout);
        return root;
    }
 
開發者ID:angcyo,項目名稱:RLibrary,代碼行數:41,代碼來源:T.java

示例3: getFooterView

import android.widget.LinearLayout; //導入方法依賴的package包/類
public View getFooterView() {
	LinearLayout footerView = new LinearLayout(getContext());
	footerView.setMinimumHeight(10);
	return footerView;
}
 
開發者ID:gaolhjy,項目名稱:cniao5,代碼行數:6,代碼來源:FriendAdapter.java


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