diff --git a/README.md b/README.md index e466d46b..3ac7b39a 100755 --- a/README.md +++ b/README.md @@ -116,8 +116,6 @@ dependencies { 选择器内嵌到其他视图容器: ```java final CarNumberPicker picker = new CarNumberPicker(this); - picker.setWidth(picker.getScreenWidthPixels() / 2); - picker.setLineConfig(new WheelView.LineConfig(0));//使用最长的分割线 picker.setOnWheelListener(new CarNumberPicker.OnWheelListener() { @Override public void onFirstWheeled(int index, String item) { @@ -217,7 +215,7 @@ dependencies { picker.show(); ``` -星座选择器(参见ConstellationPicker): +星座选择器: ```java boolean isChinese = Locale.getDefault().getDisplayLanguage().contains("中文"); OptionPicker picker = new OptionPicker(this, diff --git a/library/Common/src/main/java/cn/qqtheme/framework/popup/ConfirmPopup.java b/library/Common/src/main/java/cn/qqtheme/framework/popup/ConfirmPopup.java index af3c7b73..306ddfb9 100755 --- a/library/Common/src/main/java/cn/qqtheme/framework/popup/ConfirmPopup.java +++ b/library/Common/src/main/java/cn/qqtheme/framework/popup/ConfirmPopup.java @@ -226,14 +226,16 @@ protected View makeHeaderView() { topButtonLayout.setBackgroundColor(topBackgroundColor); topButtonLayout.setGravity(Gravity.CENTER_VERTICAL); + int padding = ConvertUtils.toPx(activity, 10); Button cancelButton = new Button(activity); cancelButton.setVisibility(cancelVisible ? View.VISIBLE : View.GONE); - RelativeLayout.LayoutParams cancelButtonLayoutParams = new RelativeLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT); + RelativeLayout.LayoutParams cancelButtonLayoutParams = new RelativeLayout.LayoutParams(WRAP_CONTENT, MATCH_PARENT); cancelButtonLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.TRUE); cancelButtonLayoutParams.addRule(RelativeLayout.CENTER_VERTICAL, RelativeLayout.TRUE); cancelButton.setLayoutParams(cancelButtonLayoutParams); cancelButton.setBackgroundColor(Color.TRANSPARENT); cancelButton.setGravity(Gravity.CENTER); + cancelButton.setPadding(padding, 0, padding, 0); if (!TextUtils.isEmpty(cancelText)) { cancelButton.setText(cancelText); } @@ -269,12 +271,13 @@ public void onClick(View v) { topButtonLayout.addView(titleView); Button submitButton = new Button(activity); - RelativeLayout.LayoutParams submitButtonLayoutParams = new RelativeLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT); + RelativeLayout.LayoutParams submitButtonLayoutParams = new RelativeLayout.LayoutParams(WRAP_CONTENT, MATCH_PARENT); submitButtonLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, RelativeLayout.TRUE); submitButtonLayoutParams.addRule(RelativeLayout.CENTER_VERTICAL, RelativeLayout.TRUE); submitButton.setLayoutParams(submitButtonLayoutParams); submitButton.setBackgroundColor(Color.TRANSPARENT); submitButton.setGravity(Gravity.CENTER); + submitButton.setPadding(padding, 0, padding, 0); if (!TextUtils.isEmpty(submitText)) { submitButton.setText(submitText); }