Both “一直” (yīzhí) and “一向” (yīxiàng) mean something close to “all along,” and deal with continuous actions. However, their uses are different, and they are a pair of words that are often confused (and tested on!). This article will try to clarify when you are supposed to use them.
“一直” means “straight” or “constantly” and it has the sense of doing something continuously "since a certain time." This means that something may have occurred, and then “一直” can be used with the action or habit since that point. It’s important to note that this point in time doesn’t necessarily have to be in the past, so “一直” can be used to say something “will happen repeatedly” in the future.
“一向” does not have the time constraint that “一直” has. Instead, it means that things have always been like they are. In this way, it is more like a habit. Furthermore, it is often used to express a habit or event that you don't like, and can also be used in conjunction with "不."
However, “一向” also can’t affect words that indicate change (as this wouldn’t be a habit), nor can it talk about constant future actions. For both of these cases, “一直” should be used instead.