本文共 1284 字,大约阅读时间需要 4 分钟。
我想这样:一个由2个箭头覆盖的ViewPager
我得到了我想要的代码.但是,我得到了lint的这些警告:
>这种布局没用(对于虚拟布局)
>嵌套权重对性能不利.
我想知道是否有更好的方法来获得我想要的UI.
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:id="@+id/dialog_instruction_pager"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical" >
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".2"
android:orientation="horizontal" >
android:id="@+id/instruction_dialog_left_arrow"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".05"
android:background="?android:attr/selectableItemBackground"
android:scaleType="fitCenter"
android:src="@drawable/arrow_left_grey" />
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".8" >
android:id="@+id/instruction_dialog_right_arrow"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".05"
android:background="?android:attr/selectableItemBackground"
android:scaleType="fitCenter"
android:src="@drawable/arrow_right_grey" />
P.S:是否有任何布局允许对齐左边,右边,底部(如RelativeLayout),还允许设置宽度,高度为百分比(如LinearLayout中的“weight”属性)?
谢谢 !
转载地址:https://blog.csdn.net/weixin_33865450/article/details/114729091 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!