本文主要是介绍DialogFragment 仿IOS弹框简单实现,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
主类:先上个图
非常简单,直接上代码:
1.主类:
package com.jgw.supercode.ui.fragment;import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;import com.jgw.supercode.R;/*** Created by zx on 2016/6/2.*/
public class CommonDialogFragment extends DialogFragment {private TextView mTvResult;private TextView mTvResultDetails;private Button mBtnLeft;private Button mBtnRight;private String mResult;private String mResultDetails;private String mLeftButtonStr;private String mRightButtonStr;private OnButtonClickListener mOnButtonClickListener;public CommonDialogFragment setResult(String result) {this.mResult = result;return this;}public CommonDialogFragment setResultDetails(String resultDetails) {this.mResultDetails = resultDetails;return this;}public CommonDialogFragment setLeftButtonStr(String leftButtonStr) {this.mLeftButtonStr = leftButtonStr;return this;}public CommonDialogFragment setRightButtonStr(String rightButtonStr) {this.mRightButtonStr = rightButtonStr;return this;}public static<
这篇关于DialogFragment 仿IOS弹框简单实现的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!