I am trying to use the line shape tool. However, the shape stroke type affects the arrows. Does it mean that I have to draw the line first, without the arrows, and then add the solid arrows to the line
I'm not sure I fully understand what you're saying. My guess is that you are trying to draw an arrow and you're not happy with the line once you use the stroke path? You'll need to change you're settings under the brush window to whatever you desire first.
One way to accomplish this is to create and arrow brush or download an arrow brush set.
Create a brush.
1. Use the custom shape tool, and select an arrow from the Custom Shape Picker.
2. Create an arrow to your liking. You can use shape (turn stroke off) or path. If you use path, make the arrow a selection and fill with black. (you can change the brush color at the time of use, for now make it black)
3. Click EDIT > DEFINE BRUSH PRESET. Name your brush and click OK.
Arrows in a line.
1. Choose your brush tool and select the arrow brush you just made from the Brush Preset Picker.
2. Open the brush panel. Check "Shape Dynamics" and run the minimum diameter to 100%.
3. Go to "Brush Tip Shape" and set your spacing to your liking.
4. Choose or create a layer you would like to place the arrows on. Create a line with the pen tool set to path.
5. Right click on the path and choose "Stroke Path".
If your using a curved line and you want the arrows to follow the line, choose "Direction" under "Angle Jitter" in the "Shape Dynamics" widow of the brush panel.
Hope that helps. If this is not what you were talking about, then disregard.
Among the many ways to achieve it, in CS6 you can now use the the line tool in shape mode to make a dashed line. There are now options similar to Illustrator's stroke and fill functions for shape layers.