Flavio Portella uses the gym equipment t at District-based Vida Fitness, which has four locations in D.C. with a fifth to open in 2012. (Xiaomei Chen/The Washington Post)

Gyms have been the answer to a tricky question for commercial real estate owners and developers in downtown Washington: Who wants to rent space in the basement?

Typically there are few stores willing to rent space underground. Even with sidewalk-level signage, a lack of display windows is less than ideal for retailers who rely on visibility to attract a certain number of customers. Some restaurants and bars are willing to rent space underground for their kitchen, storage and the like, but often only when at least their entrance and sometimes a portion of their seating is on the main floor.

Gyms, with their membership-based clientele, some need for privacy and willingness to line their walls with mirrors, have been perfect for filling basements. High-rise apartment, condo and office builders have stuffed their self-operated gyms in the basement, and in the densest real estate markets of Washington, brand-name gyms frequently take space underground, sometimes nearly entirely underground. Consider the Results Gym at Farragut Square, the Washington Sports Club at Gallery Place or the L.A. Fitness in White Flint.

But that dynamic may be changing. Although many gyms will continue to be underground, some developers are renting or reserving space for them in parts of their buildings that afford natural light and — in some cases — a decent view.

This is happening for a number of reasons, according to developers and leasing brokers. First, the sagging retail market has allowed some gyms to afford above-ground or street-level space that they could not have before. This also aided the rapid growth of some independent chains with new and different fitness and health concepts. Vida Fitness recently opened a U Street location last year with a rooftop “Penthouse Club,” featuring a private pool, fire pit and bar.

Washington is one of the only markets in the country where the fitness industry continues to expand, according to John Bemis, executive vice president at Jones Lang LaSalle, and gyms in the area are moving aggressively in the slow economy. “They’re taking advantage of not only lower rental rates, but they’re taking advantage of opportunities for better locations,” Bemis said.

Bemis said cost-friendly gyms such as Planet Fitness and the YMCA are faring well, alongside upscale gyms such as Equinox, which he said caters to people who “were not as negatively affected by the recession.”

Another factor in the growth here is Washington’s highly competitive apartment market, in which developers are racing to build or renovate new units in order to take advantage of rising rents and low vacancy rates. The race for top rental dollars has some apartment builders and managers emphasizing better fitness experiences for residents as a way of distinguishing their buildings.

StonebridgeCarras, the developer who recently built Flats 130 at Constitution Square, a mixed-use apartment project in NoMa, put its two-story gym on the second and third floors, allowing members to look out on the street while they exercise. JBG Rosenfeld, which is building a mixed-use Tysons Corner project with a new Wal-Mart store, is putting a 24 Hour Fitness Health Club on top. JBG plans to build apartments for the project in future phases.

Greystar, the country’s largest manager of apartment units, is entering the Washington market for the first time and putting a heavy emphasis on quality gym space in its efforts to upgrade apartment properties and attract higher rents. In October, after Greystar announced a number of local acquisitions, Kevin Sheehan, managing director for local real estate, said building the biggest and most quality gym possible in apartment buildings would be key in beating the market.