All required avionics equipment are tested and qualified for specific operating conditions. Those that qualify for installation in humid conditions or conditions that promote condensation, are protected by various means, most common of which is applying a protective coating.
Using humidity control is far too complex and cost prohibitive. Besides, aircraft air is generally very dry. The main problem with humidity and avionics comes in the form of condensation when cold avionics components are exposed to relatively humid warm air as the aircraft is started. After a few minutes of operation, the equipment temperature rises above the dew point and further "humidity" problems are no more.