KiranJasvanee / OnlyPictures

A simple and flexible way to add source of overlapping circular pictures, currently supports horizontal overlapping or distant pictures with great layout flexibility.
MIT License
675 stars 91 forks source link

How to change the background color(i.e brown color) #22

Open VaraPrasad62 opened 3 years ago

VaraPrasad62 commented 3 years ago

[

Screen Shot 2021-05-02 at 11 09 36 AM

](url)

nvd3351 commented 3 years ago

@VaraPrasad62 did you get a solution? @KiranJasvanee could you please help resolve this?

MrinalTyagi commented 3 years ago

@VaraPrasad62 @KiranJasvanee just comment line 458 in OnlyPictures.swift file. There stackView's background color has been set to brown.

3O1 commented 3 years ago

In OnlyPictures.swift change it to whatever color you like. I have it set to clear here self.stackView.backgroundColor = UIColor.clear

itenfay commented 2 years ago

Screen Shot 2021-05-02 at 11 09 36 AM

@VaraPrasad62 @MrinalTyagi The background color can be modified using runtime,as follows:

guard let ivarName = ("stackView" as NSString).utf8String else {
    return
}
guard let ivar = class_getInstanceVariable(OnlyPictures.self, ivarName) else {
    return
}
if let stackView = object_getIvar(onlyPictures, ivar) as? UIStackView {
    stackView.backgroundColor = .clear
}
hexalitics commented 2 years ago

The background color can be change using this onlyPictures.subviews.first?.subviews.first?.subviews.first?.backgroundColor = YOUR_COLOR