FrameLayoutの高さを400に設定していますが、64のままです。
frame_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</FrameLayout>
MyClass.java
container = (FrameLayout) inflater.inflate(R.layout.frame_layout, scrollFrame, false);
scrollFrame.addView(container);
container.setLayoutParams(new
ScrollView.LayoutParams(ScrollView.LayoutParams.MATCH_PARENT, 400));
Log.d("Output", "FrameLayout Height: " + container.getHeight());
出力
FrameLayout Height: 64
xmlでlayout_height="400"を設定しても、64のままです。これはScrollViewsと関係があると思います。(ただし、LinearLayoutsはコードに他の多くの問題を引き起こすため、使用できません。)FrameLayoutを、配置したビューに基づいて動的にサイズ変更する必要があります。(LinearLayoutは自動的にサイズ変更されますが、表示しようとしている高さの10倍にサイズ変更され、ScrollViewが大きくなりすぎます。次に、LinearLayoutが手動で配置しようとしているビューに位置を強制しようとするため、位置の問題が発生します)。