当前位置: 首页>>代码示例>>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;未经允许,请勿转载。