答案 0 :(得分:1)
card_offset = (total_width - card_width) / (number_of_cards - 1) * card_index;
示例:
1st card offset = (1000 - 500) / (4 - 1) * 0 = 0
2st card offset = (1000 - 500) / (4 - 1) * 1 = 167
3st card offset = (1000 - 500) / (4 - 1) * 2 = 334
4st card offset = (1000 - 500) / (4 - 1) * 3 = 500