Yes, inversion of control violates the encapsulation principle. Sigh, people are committing the fallacy of authority so much here. Just because some random authority says SOLID is good doesn't mean that it definitely good. Also, it doesn't mean that even if you use SOLID in a good way, that doesn't throw a wrecking ball into something else like encapsulation.
I've used IOC many times. I think it is very useful for unit testing but if unit testing didn't exist, I would get rid of IOC in a heartbeat. It makes code messy and hard to trace precisely because it violates encapsulation. Knowledge about how to operate that was once encapsulated is now extracted and put outside of that encapsulation boundary.