divider

Change the divider height of listview dynamically?

别来无恙 提交于 2019-11-30 05:43:17
问题 This question has been asked here a link Also I want to clarify the question I have 10 List Items in a Listview I want to have the deviderheight of each List Items differently like for first Item it should be setDividerheight(2) for 2nd setDividerheight(4) like this.. I have made a custom Adapeter in which I am setting my Layout Like public View getView(int position, View convertView, ViewGroup parent) { View v = super.getView(position, convertView, parent); if(position ==2) { if (v !=

How to get dividers in NavigationView menu without titles?

柔情痞子 提交于 2019-11-30 05:37:24
I am using the new NavigationView to create my navigation drawer menu from XML. I need to place a divider between the section menu items, which switch between the sections of my app, and the settings and help & support links at the bottom. In all the examples I've seen, I see how this can be done by putting another <menu> within an <item> , but the <item> requires to have the android:title attribute, so the best I can do is make the title blank, which leaves an empty space before the settings and help & feedback. <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android

Add margins to divider in RecyclerView

随声附和 提交于 2019-11-30 04:53:53
i am building an android app which is using RecyclerView . I want to add dividers to RecyclerView , which I did using this code: DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), linearLayoutManager.getOrientation()); recyclerView.addItemDecoration(dividerItemDecoration); So far everything works fine. However, the divider is taking the size of full screen and I want to add margins to it. Is there any way that I can add margins to the divider using a method that will add some space to the rectangle drawn and not by creating a custom drawable

Setting different divider color to each element in list view

假如想象 提交于 2019-11-30 04:21:58
问题 I want to have a list with different dividers between the list elements. I have used this code to define a white divider with height 1: _listView.setDivider(new ColorDrawable(Color.WHITE)); _listView.setDividerHeight(1); However it sets the divider for all the element to be white, and I want only some of them to be white and the other in different color. How can i do that? 回答1: Set the divider to height to 0 and implement a View in your item layout with the height of 1 and change its color

Remove ion item divider

时光怂恿深爱的人放手 提交于 2019-11-30 03:00:48
How I can remove <ion-item> divider? I have the following code to show 4 items in a row: <ion-row ion-list> <ion-col width-25 *ngFor="let player of players"> <ion-item color="dark"> <ion-avatar item-left> <img [src]="photo" class="img img-circle"/> </ion-avatar> {{user.name}} </ion-item> </ion-col> </ion-row> and the output shows 4 images in a row, as excepted, but each image has a white divider below it. I don't want any divider. I tried to set style="border:none" but it didn't do it. use no-lines <ion-row ion-list> <ion-col width-25 *ngFor="let player of players"> <ion-item no-lines color=

How to get dividers in NavigationView menu without titles?

六月ゝ 毕业季﹏ 提交于 2019-11-29 06:01:43
问题 I am using the new NavigationView to create my navigation drawer menu from XML. I need to place a divider between the section menu items, which switch between the sections of my app, and the settings and help & support links at the bottom. In all the examples I've seen, I see how this can be done by putting another <menu> within an <item> , but the <item> requires to have the android:title attribute, so the best I can do is make the title blank, which leaves an empty space before the settings

How can I remove the divider between the ActionBar and the tabs

三世轮回 提交于 2019-11-29 04:33:07
I'm trying to remove the divider between the ActionBar and the tabs but I did not succeed yet. I've tried this <item name="android:actionBarDivider">@color/tab_color</item> in my style.xml but nothing. In few words I'd like to have something like this: Here's my style.xml: <style name="AppTheme" parent="Theme.AppCompat.Light"/> <style name="Theme.Styled" parent="@style/Theme.AppCompat.Light"> <item name="android:windowContentOverlay">@null</item> <item name="android:windowDisablePreview">true</item> <item name="android:actionBarItemBackground">@drawable/selectable_background_example</item>

Customize divider / separator in dropdown of an AutocompleteTextview

一笑奈何 提交于 2019-11-29 03:39:55
I've seen this question asked some other times on the site, but no one couldn't get any answer. Is there any way to customize the appearance of the divider in the dropdown showing when using an AutocompleteTextview in android? It's pretty easy for a ListView, but using only an ArrayAdapter for the autocompletetextview, is there any way to customize the divider. (Not the textview, I already know doing that) Im not sure how you can do it for single AutoCompleteTextView but I know how to set it for the whole application. This should also help you :) <style name="MyTheme" parent="AppTheme"> <item

Add margins to divider in RecyclerView

怎甘沉沦 提交于 2019-11-29 02:03:28
问题 i am building an android app which is using RecyclerView . I want to add dividers to RecyclerView , which I did using this code: DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), linearLayoutManager.getOrientation()); recyclerView.addItemDecoration(dividerItemDecoration); So far everything works fine. However, the divider is taking the size of full screen and I want to add margins to it. Is there any way that I can add margins to the divider

Android divider color DatePicker dialog

泄露秘密 提交于 2019-11-28 17:39:55
I'm trying to change color of the blue dividers for a DatePicker in a dialog. This is just a normal DialogFragment with a DatePicker and a ButtonBar. Does anyone know to change these dividers, or if it's even possible without replacing the entire DatePicker with a custom one? Mini rant Now I've seen too many answers suggesting the following code: <style name="datePickerTheme" parent="@android:style/Widget.DeviceDefault.DatePicker"> <item name="android:divider">**your @drawable/ or @color/ here**</item> </style> Which simply does not work. Have you guys tried this before suggesting this code?