i tried to get the android:layout_weight
in my function. this is my xml code:
<LinearLayout
android:id="@+id/myID"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="14"
android:clickable="true"
android:orientation="horizontal">
......
</LinearLayout>
And the Part of my function:
import android.widget.LinearLayout;
import android.widget.TableLayout;
import android.widget.TableLayout.LayoutParams;
....
LinearLayout layout = (LinearLayout) findViewById(R.id.myID);
But when i try to call layout.getLayoutParams()
there is no weight
variable, only width, heigth, ...
Is this beacause of the imported packages or why does getLayoutParams()
not have weight?
this is the same issue as here, but he also couldn't solve it: How do I get the `layout_weight` of a TextView?