Closed tiper closed 4 years ago
Hi @rajvimal, you question is not related with this issue
Have you tried with LayoutInflater
?
MaterialSpinner spinner = LayoutInflater.from(context).inflate(R.layout.spinner_outlined_box, null);
The spinner_outlined_box
can be:
<?xml version="1.0" encoding="utf-8"?> <com.tiper.MaterialSpinner xmlns:android="http://schemas.android.com/apk/res/android" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" android:layout_width="match_parent" android:layout_height="wrap_content" />
How do i implement style in java code programatically.I tried in two ways such as :
1st : com.tiper.MaterialSpinner materialSpinner = new com.tiper.MaterialSpinner(this,null,R.style.Widget_MaterialComponents_TextInputLayout_OutlinedBox); ///// Not working
2nd : com.tiper.MaterialSpinner spinner = new com.tiper.MaterialSpinner(new androidx.appcompat.view.ContextThemeWrapper(this, R.style.Widget_MaterialComponents_TextInputLayout_OutlinedBox));
Originally posted by @rajvimal in https://github.com/tiper/MaterialSpinner/issues/6#issuecomment-613498175