how to reduce fix shadow effect in recycler-view below item in android
this is my image i have used card view to display item in recyclerview view . Below is xml
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/cardTicketName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="Here will be the text"
android:textColor="#484848"
android:padding="20dp"
android:textSize="15dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
that below item bottom shadow is more than top shadow and also same problem happening when we scroll top item to bottom then shadow increase of bottom and when again scroll to top same item its shadow effect decrees
how to fix this issue?
android android-recyclerview
add a comment |
this is my image i have used card view to display item in recyclerview view . Below is xml
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/cardTicketName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="Here will be the text"
android:textColor="#484848"
android:padding="20dp"
android:textSize="15dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
that below item bottom shadow is more than top shadow and also same problem happening when we scroll top item to bottom then shadow increase of bottom and when again scroll to top same item its shadow effect decrees
how to fix this issue?
android android-recyclerview
add a comment |
this is my image i have used card view to display item in recyclerview view . Below is xml
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/cardTicketName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="Here will be the text"
android:textColor="#484848"
android:padding="20dp"
android:textSize="15dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
that below item bottom shadow is more than top shadow and also same problem happening when we scroll top item to bottom then shadow increase of bottom and when again scroll to top same item its shadow effect decrees
how to fix this issue?
android android-recyclerview
this is my image i have used card view to display item in recyclerview view . Below is xml
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/cardTicketName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="Here will be the text"
android:textColor="#484848"
android:padding="20dp"
android:textSize="15dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
that below item bottom shadow is more than top shadow and also same problem happening when we scroll top item to bottom then shadow increase of bottom and when again scroll to top same item its shadow effect decrees
how to fix this issue?
android android-recyclerview
android android-recyclerview
edited Nov 23 at 4:49
fnascimento
7811015
7811015
asked Nov 22 at 14:45
Bhaskar Mart
105
105
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
The Android framework uses a combination of two simulated light sources to create shadow effects. One of these is a general ambient light, so that everything with elevation casts a little bit of shadow on all sides. The other, however, is a simulated point light near the top of the screen.
This point light's position means that bottom shadows are always larger than top shadows. It also means that bottom shadows near the bottom of the screen are always larger than bottom shadows near the top of the screen.
There is no way to disable this behavior. If you want to use Android's built-in elevation/shadow framework, this is how it works.
You can simulate your own shadows by doing custom drawing or by using a gradient with semi-transparent black, but you will find both of these significantly more difficult than simply accepting that this is how shadows work and this is what users are expecting.
https://material.io/design/environment/light-shadows.html
add a comment |
Add card_view:cardElevation="0dp"
to your CardView
no its not working when i use this then shadow effect become remove @Anthony Fillion-Maillet
– Bhaskar Mart
Nov 22 at 14:49
add a comment |
try this
to reduce the shadow reduce the cardElevation size.
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
card_view:cardElevation="1dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/cardTicketName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="Here will be the text"
android:textColor="#484848"
android:padding="20dp"
android:textSize="15dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53433378%2fhow-to-reduce-fix-shadow-effect-in-recycler-view-below-item-in-android%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
The Android framework uses a combination of two simulated light sources to create shadow effects. One of these is a general ambient light, so that everything with elevation casts a little bit of shadow on all sides. The other, however, is a simulated point light near the top of the screen.
This point light's position means that bottom shadows are always larger than top shadows. It also means that bottom shadows near the bottom of the screen are always larger than bottom shadows near the top of the screen.
There is no way to disable this behavior. If you want to use Android's built-in elevation/shadow framework, this is how it works.
You can simulate your own shadows by doing custom drawing or by using a gradient with semi-transparent black, but you will find both of these significantly more difficult than simply accepting that this is how shadows work and this is what users are expecting.
https://material.io/design/environment/light-shadows.html
add a comment |
The Android framework uses a combination of two simulated light sources to create shadow effects. One of these is a general ambient light, so that everything with elevation casts a little bit of shadow on all sides. The other, however, is a simulated point light near the top of the screen.
This point light's position means that bottom shadows are always larger than top shadows. It also means that bottom shadows near the bottom of the screen are always larger than bottom shadows near the top of the screen.
There is no way to disable this behavior. If you want to use Android's built-in elevation/shadow framework, this is how it works.
You can simulate your own shadows by doing custom drawing or by using a gradient with semi-transparent black, but you will find both of these significantly more difficult than simply accepting that this is how shadows work and this is what users are expecting.
https://material.io/design/environment/light-shadows.html
add a comment |
The Android framework uses a combination of two simulated light sources to create shadow effects. One of these is a general ambient light, so that everything with elevation casts a little bit of shadow on all sides. The other, however, is a simulated point light near the top of the screen.
This point light's position means that bottom shadows are always larger than top shadows. It also means that bottom shadows near the bottom of the screen are always larger than bottom shadows near the top of the screen.
There is no way to disable this behavior. If you want to use Android's built-in elevation/shadow framework, this is how it works.
You can simulate your own shadows by doing custom drawing or by using a gradient with semi-transparent black, but you will find both of these significantly more difficult than simply accepting that this is how shadows work and this is what users are expecting.
https://material.io/design/environment/light-shadows.html
The Android framework uses a combination of two simulated light sources to create shadow effects. One of these is a general ambient light, so that everything with elevation casts a little bit of shadow on all sides. The other, however, is a simulated point light near the top of the screen.
This point light's position means that bottom shadows are always larger than top shadows. It also means that bottom shadows near the bottom of the screen are always larger than bottom shadows near the top of the screen.
There is no way to disable this behavior. If you want to use Android's built-in elevation/shadow framework, this is how it works.
You can simulate your own shadows by doing custom drawing or by using a gradient with semi-transparent black, but you will find both of these significantly more difficult than simply accepting that this is how shadows work and this is what users are expecting.
https://material.io/design/environment/light-shadows.html
answered Nov 22 at 18:17
Ben P.
22.3k31846
22.3k31846
add a comment |
add a comment |
Add card_view:cardElevation="0dp"
to your CardView
no its not working when i use this then shadow effect become remove @Anthony Fillion-Maillet
– Bhaskar Mart
Nov 22 at 14:49
add a comment |
Add card_view:cardElevation="0dp"
to your CardView
no its not working when i use this then shadow effect become remove @Anthony Fillion-Maillet
– Bhaskar Mart
Nov 22 at 14:49
add a comment |
Add card_view:cardElevation="0dp"
to your CardView
Add card_view:cardElevation="0dp"
to your CardView
answered Nov 22 at 14:47
Anthony Fillion-Maillet
160211
160211
no its not working when i use this then shadow effect become remove @Anthony Fillion-Maillet
– Bhaskar Mart
Nov 22 at 14:49
add a comment |
no its not working when i use this then shadow effect become remove @Anthony Fillion-Maillet
– Bhaskar Mart
Nov 22 at 14:49
no its not working when i use this then shadow effect become remove @Anthony Fillion-Maillet
– Bhaskar Mart
Nov 22 at 14:49
no its not working when i use this then shadow effect become remove @Anthony Fillion-Maillet
– Bhaskar Mart
Nov 22 at 14:49
add a comment |
try this
to reduce the shadow reduce the cardElevation size.
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
card_view:cardElevation="1dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/cardTicketName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="Here will be the text"
android:textColor="#484848"
android:padding="20dp"
android:textSize="15dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
add a comment |
try this
to reduce the shadow reduce the cardElevation size.
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
card_view:cardElevation="1dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/cardTicketName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="Here will be the text"
android:textColor="#484848"
android:padding="20dp"
android:textSize="15dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
add a comment |
try this
to reduce the shadow reduce the cardElevation size.
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
card_view:cardElevation="1dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/cardTicketName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="Here will be the text"
android:textColor="#484848"
android:padding="20dp"
android:textSize="15dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
try this
to reduce the shadow reduce the cardElevation size.
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
card_view:cardElevation="1dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/cardTicketName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="Here will be the text"
android:textColor="#484848"
android:padding="20dp"
android:textSize="15dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
answered Nov 22 at 14:50
Aniruddh Parihar
2,15911027
2,15911027
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53433378%2fhow-to-reduce-fix-shadow-effect-in-recycler-view-below-item-in-android%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown