我有一个视图alertpopup.xml
,其中包含:
<LinearLayout
android:id="@+id/navBarTop"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="5dp"
android:background="@drawable/alert_nav_bar"
android:clickable="true"
android:orientation="horizontal"
android:padding="0dp"
android:visibility="visible">
<RelativeLayout
android:id="@+id/navBarBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical" >
<com.w.view.text.WTextView
android:id="@+id/navBarDirection"
android:layout_width="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:layout_marginBottom="5dp"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:background="@drawable/big_direction_right"
android:gravity="center"
android:textColor="@color/solid_white"
android:textSize="24sp"
android:textStyle="bold" />
</RelativeLayout>
..
这一行被执行:
inflater.inflate(R.layout.alert_nav_bar, this);
后来这个:
public NavBar(View view, BottomBar bottomBar) {
this.view = view;
this.bottomBar = bottomBar;
bottomBar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View paramView) {
NavBarManager navBarNativeManager = NativeManager.getInstance().getNavBarManager();
navBarNativeManager.showNavigationResult();
}
});
instImages = instImagesRight;
topView = view.findViewById(R.id.navBarTop);
nextView = view.findViewById(R.id.navBarThen);
boxView = view.findViewById(R.id.navBarBox);
为什么所有高度都只有0?
特别是topview
哪个有固定高度?
<LinearLayout
android:id="@+id/navBarTop"
android:layout_width="match_parent"
android:layout_height="60dp"