我一直遵守以下的鏈接,這樣我的應用程序可以支持不同的屏幕尺寸:支持android系統多屏在單個佈局
Supporting multiple screens in android
該解決方案完美的作品。但我擔心的是,當我有一個具有8-9個屏幕的android應用程序時,這意味着我將擁有8-9個不同的.xml佈局文件。現在爲了支持文件夾分叉的所有屏幕,這意味着我已經管理了幾乎50多個xml文件的佈局和UI的簡單更改,我必須去所有文件夾並在xml文件中實現該更改。那麼能不能有一個更好的方法,我的意思是這樣一種佈局,可以調整控件本身或類似的東西?
基本上我想要的是,我不想有一個屏幕的多個佈局文件。我想要寫一些類似於我的layout.xml文件的文件,並且在該文件中,我使用了這樣一種佈局,可根據屏幕大小調整我的UI組件。就像我們在java swing應用程序中有Bag佈局一樣。 –
我知道你要求你必須根據屏幕尺寸進行計算。然後根據此更改您的佈局組件。但我不知道通過這種方式,你在每個屏幕上都有很好的佈局。 –
在此鏈接中檢查一些基於計算的答案。希望它可以幫助你。 http://stackoverflow.com/questions/21274692/font-size-of-text –