android中可以有两个焦点吗,android – 如何通过焦点在屏幕上调整两个片段的大小?...
我有三個片段,前兩個填充80%的屏幕,最后一個填充其余的片段(這個片段永遠不會改變大小).我希望,在用戶(焦點)輸入片段后,調(diào)整片段的大小,使其填滿屏幕的70%(將10%留給另一個).像這樣:
可以通過動態(tài)改變碎片的重量嗎?
或者有更好的方法來實現(xiàn)這一目標?
這是我現(xiàn)在在XML中的代碼:
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1.0">
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".8">
android:id="@+id/MainLinear"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:weightSum="1.0">
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".5"/>
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".5"/>
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".2"/>
總結(jié)
以上是生活随笔為你收集整理的android中可以有两个焦点吗,android – 如何通过焦点在屏幕上调整两个片段的大小?...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android config.mk,an
- 下一篇: android finish 区别,An