如何在Android Studio中创建这样的微型布局?

时间:2018-11-29 21:07:41

标签: android android-studio android-layout

2 个答案:

答案 0 :(得分:0)

我认为您要尝试的是一个警告对话框...类似这样的

SELECT customer_id, customer_name_first, customer_name_last
FROM oeOrdersPriorYear 
WHERE order_month IN ('4','5','6')   -- consider only from April, May and June
GROUP BY customer_id, customer_name_first, customer_name_last 
HAVING SUM(order_month = '4') AND   -- atleast one in April
       SUM(order_month = '5') AND   -- atleast one in May 
       NOT SUM(order_month = '6')   -- no order in June

答案 1 :(得分:0)

尝试

/* using sign out alert for app*/
private void dialogBox() {
    android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(getActivity());
    String titleText = "Share using Wi-Fi Direct?";
    ForegroundColorSpan foregroundColorSpan = new ForegroundColorSpan(Color.BLACK);
    SpannableStringBuilder ssBuilder = new SpannableStringBuilder(titleText);
    ssBuilder.setSpan(
            foregroundColorSpan,
            0,
            titleText.length(),
            Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
    );
    builder.setCancelable(false);
    builder.setTitle(ssBuilder);

        builder.setMessage("You can only share folders using Wi-Fi Direct");


    builder.setPositiveButton("SHARE VIA WI-FI DIRECT", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
           // your code
        }
    });
    builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();
        }
    });
    // Create the alert dialog
    android.support.v7.app.AlertDialog dialog = builder.create();
    // Finally, display the alert dialog
    dialog.show();
    // Get the alert dialog buttons reference
    Button positiveButton = dialog.getButton(android.support.v7.app.AlertDialog.BUTTON_POSITIVE);
    Button negativeButton = dialog.getButton(AlertDialog.BUTTON_NEGATIVE);
    // Change the alert dialog buttons text and background color
    positiveButton.setTextColor(Color.parseColor("#00aff1"));
    negativeButton.setTextColor(Color.parseColor("#00aff1"));
}
  • 您正在使用警报对话框和条板箱自定义对话框在下面的屏幕中显示迷你布局

    enter image description here

我希望它能对您有所帮助