大佬教程收集整理的这篇文章主要介绍了Android 7.1.1上的DatePicker添加了额外的填充/边距,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<LinearLayout xmlns:android="http://scheR_685_11845@as.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <DatePicker android:id="@+id/date_picker" android:layout_width="wrap_content" android:layout_height="wrap_content" android:endYear="2012" android:startYear="1930" /> </LinearLayout>
@Override protected void onCreate(Bundle savedInstanceStatE) { super.onCreate(savedInstanceStatE); setContentView(R.layout.activity_user_attributes); assert getSupportActionBar() != null; getSupportActionBar().settitle("Register"); final TextView birthDateSELEctedTextView = (TextView) findViewById(R.id.text_view_birth_datE); Button dialogopenButton = (Button) findViewById(R.id.button_dialog_date_picker); dialogopenButton.setOnClickListener(new View.onClickListener() { @Override public void onClick(View v) { final Dialog dialog = new Dialog(UserAttributesActivity.this); final AlertDialog.builder builder = new AlertDialog.builder(UserAttributesActivity.this); LayoutInflater inflater = getLayoutInflater(); View dialogView = inflater.inflate(R.layout.dialog_date_picker,null); builder.setView(dialogView); final DatePicker datePicker = (DatePicker) dialogView.findViewById(R.id.date_picker); builder.setPositiveButton("OK",new DialogInterface.onClickListener() { @Override public void onClick(DialogInterface dialog,int which) { day = datePicker.getDayOfMonth(); month = datePicker.getMonth() + 1; year = datePicker.getYear(); String date = "" + day + "/" + month + "/" + year; birthDateSELEctedTextView.setText(datE); } }); builder.setNegativeButton("Cancel",int which) { } }); builder.show(); } }); }
以上是大佬教程为你收集整理的Android 7.1.1上的DatePicker添加了额外的填充/边距全部内容,希望文章能够帮你解决Android 7.1.1上的DatePicker添加了额外的填充/边距所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。