Style for the view displayed in the web view when the user selects a combo box

I need to find which style / theme is used by the webview for the view that appears when the user clicks on the combo box on the html page.

enter image description here

On some phones, the text is cut, and I need to reduce the size of the text or allow each line to span multiple lines.

I have tried 5 styles so far, without success:

<style name="teststyle1" parent="@android:style/Widget.DropDownItem.Spinner"> <item name="android:singleLine">false</item> <item name="android:textStyle">bold</item> <item name="android:textColor">#FF00FF</item> <item name="android:checkMark">@drawable/another_btn_radio</item> </style> <style name="teststyle2" parent="@android:style/Widget.TextView.SpinnerItem"> <item name="android:singleLine">false</item> <item name="android:textStyle">bold</item> <item name="android:textColor">#FF00FF</item> <item name="android:checkMark">@drawable/another_btn_radio</item> </style> <style name="teststyle3" parent="@android:style/Widget.DropDownItem"> <item name="android:singleLine">false</item> <item name="android:textStyle">bold</item> <item name="android:textColor">#FF00FF</item> <item name="android:checkMark">@drawable/another_btn_radio</item> </style> <style name="teststyle4" parent="@android:style/Widget.Spinner"> <item name="android:singleLine">false</item> <item name="android:textStyle">bold</item> <item name="android:textColor">#FF00FF</item> <item name="android:checkMark">@drawable/another_btn_radio</item> </style> <style name="teststyle5" parent="@android:style/Widget.Spinner"> <item name="android:singleLine">false</item> <item name="android:textStyle">bold</item> <item name="android:textColor">#FF00FF</item> <item name="android:checkMark">@drawable/another_btn_radio</item> </style> 

Any help would be greatly appreciated.

+6
source share
3 answers

See AndroidManifest.xml in the <activity> for the activity that these screens occur. In the android:theme property, you set the theme or in this case you will know what the current one is! It looks like it might be Theme.Dark , but I'm not sure about the top of my head

Or, if you're just trying to change the list items in this view to fit the title, you need to change the font size. You can set it in layout or programmatically in Office with:

 TextView view = (TextView) findViewById('R.id.your_view'); view.setTextSize(12); // ^^^ will set font size to 12dp, you can use 'setTextSize(pt,12)' for different units 

I would look at AndroidManifest.xml and look at the topic of activity, it looks like a system style. A source:

http://developer.android.com/guide/topics/ui/themes.html


Additional links to view




Another hit in this


This project on github? Could you post your view registration logic?

0
source

Allowing multiple lines would be better. If you set only the size. It will be changed if you want to add a little words.

+1
source

This change will actually be made on the HTML side not in Android. Use the CSS tag for web design to specify the appearance style, after which you can work with the wrapper using CSS.

URL: http://css-infos.net/property/-webkit-appearance

+1
source

Source: https://habr.com/ru/post/920966/


All Articles