AndroidImageSlider icon indicating copy to clipboard operation
AndroidImageSlider copied to clipboard

How to hide the Grey Background of The Description

Open longphandev opened this issue 8 years ago • 10 comments

Hi there, I had used this lib and it's working perfectly, but I have 1 issue when I try to hide the Grey Background of The Description, so how can I fix it. Thanks alot :)

longphandev avatar Jan 12 '16 03:01 longphandev

I have a same problem :)

gilarpurwita avatar Feb 01 '16 09:02 gilarpurwita

Solved this issue. I created custom SliderView:

import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.daimajia.slider.library.R.id;
import com.daimajia.slider.library.R.layout;
import com.daimajia.slider.library.SliderTypes.BaseSliderView;

public class CustomSliderView extends BaseSliderView {

    public CustomSliderView(Context context) {
        super(context);
    }

    public View getView() {

        View v = LayoutInflater.from(this.getContext()).inflate(layout.render_type_text, null);
        ImageView target = (ImageView) v.findViewById(id.daimajia_slider_image);
        LinearLayout frame = (LinearLayout) v.findViewById(id.description_layout);
        frame.setBackgroundColor(Color.TRANSPARENT);

//      if you need description
//      description.setText(this.getDescription());

        this.bindEventAndShow(v, target);

        return v;
    }

And then you can use it for for adding images instead of DefaultSliderView or BaseSliderView

Hope it helps someone

Leonid-Kiev avatar Feb 09 '16 18:02 Leonid-Kiev

it works perfect! Thank u bro

leonardo24 avatar Feb 15 '16 03:02 leonardo24

How to use it ?

danzhu10 avatar Feb 25 '16 13:02 danzhu10

Just create a new java class and copy that code.

Then in your activity where u create the slider. On the bucle you have something like this:

for(String name : url_maps.keySet()){ TextSliderView textSliderView = new TextSliderView(getContext()); // initialize a SliderLayout textSliderView .image(url_maps.get(name)) .setScaleType(BaseSliderView.ScaleType.Fit); mDemoSlider.addSlider(textSliderView); }

Change the TextSliderView for the new class you create. So if u name the class "CustomSliderView" for example it will be:

CustomSliderView textSliderView = new CustomSliderView(getContext());

Sry about my inglish skills. Hope this helps!

leonardo24 avatar Mar 13 '16 23:03 leonardo24

It is not necessary to create a custom slider view. Just use the DefaultSliderView, instead of TextSliderView. The TextSliderView have the specific purpose of displaying image with text. The DefaultSliderView show only the image.

andreyluiz avatar Mar 29 '16 15:03 andreyluiz

Thanks. It works :)

snehazanzane avatar Jan 31 '17 06:01 snehazanzane

@andreyluiz yeah it works 👍

Rishabhk07 avatar Aug 25 '17 01:08 Rishabhk07

Easy Solution: Just replace TextSliderView with DefaultSliderView and then gray bottom bar will be hide :)

BhoomiKhan avatar Dec 24 '20 11:12 BhoomiKhan

please make a color of transparent in values colors by thi code of line #0000ffff now in xml set title background color with line of code app:iss_title_background="@color/transparent"

brij21141 avatar Jan 28 '21 05:01 brij21141