Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这里没看懂,可以解释一下吗 #78

Closed
powerzd opened this issue Mar 15, 2023 · 4 comments
Closed

这里没看懂,可以解释一下吗 #78

powerzd opened this issue Mar 15, 2023 · 4 comments

Comments

@powerzd
Copy link

powerzd commented Mar 15, 2023

image

小写view作为tag会有问题,没办法通过编译啊,我尝试将view改为View,使用的时候会抛出异常

image

@loper7
Copy link
Owner

loper7 commented Mar 16, 2023

这是使用自定义view的一种方法,studio可能会报红但是不会影响编译运行

@loper7 loper7 closed this as completed Mar 16, 2023
@powerzd
Copy link
Author

powerzd commented Mar 16, 2023

Android Studio Giraffe | 2022.3.1 Canary 8 无法通过编译

@loper7
Copy link
Owner

loper7 commented Mar 17, 2023

我使用2022.1.1 Patch 1 是没有问题的,需要注意你项目本身有没有引用android.widget.numberpicker类。
如果实在不行,可以直接将该xml删除 在numberPicker中修改相关代码自行创建mSelectedText,例如:

 // input text
        mSelectedText = new EditText(context);
        mSelectedText.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT));
        mSelectedText.setGravity(Gravity.CENTER);
        mSelectedText.setSingleLine(true);
        mSelectedText.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
        mSelectedText.setEnabled(false);
        mSelectedText.setFocusable(false);
        mSelectedText.setVisibility(View.INVISIBLE);
        mSelectedText.setImeOptions(EditorInfo.IME_ACTION_NONE);

@tr15tan
Copy link

tr15tan commented Mar 29, 2023

我使用2022.1.1 Patch 1 是没有问题的,需要注意你项目本身有没有引用android.widget.numberpicker类。 如果实在不行,可以直接将该xml删除 在numberPicker中修改相关代码自行创建mSelectedText,例如:

 // input text
        mSelectedText = new EditText(context);
        mSelectedText.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT));
        mSelectedText.setGravity(Gravity.CENTER);
        mSelectedText.setSingleLine(true);
        mSelectedText.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
        mSelectedText.setEnabled(false);
        mSelectedText.setFocusable(false);
        mSelectedText.setVisibility(View.INVISIBLE);
        mSelectedText.setImeOptions(EditorInfo.IME_ACTION_NONE);

请问要如何引入 android.widget.numberpicker 类?我看 date_time_picker 这个 module 的 build.gradle 中也没有进行什么引入呀,只有一个 com.google.android.material:material:1.3.0 ,我项目本身也是添加了这个库的(应该和这个没有关系吧)。自行创建的mSelectedText 我试过了是可行的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants