re-setting a TextView height programmatically












33















I want to reset a textView height after I have added it to the main window in the xml file.



inside a RelativeLayout,



  <TextView
android:id="@+id/text_l"
android:layout_width="50sp"
android:layout_height="50sp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="10sp"
android:layout_marginTop="145dp"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000000" >
</TextView>


I just want to change it from 50 to 70:



I tried:



 TextView text = (TextView)findViewById(R.id.text_l);
text.setHeight(70);


but nothing changed.










share|improve this question

























  • Try this: stackoverflow.com/questions/3522224/…

    – Nitesh Khosla
    Feb 7 '12 at 11:33


















33















I want to reset a textView height after I have added it to the main window in the xml file.



inside a RelativeLayout,



  <TextView
android:id="@+id/text_l"
android:layout_width="50sp"
android:layout_height="50sp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="10sp"
android:layout_marginTop="145dp"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000000" >
</TextView>


I just want to change it from 50 to 70:



I tried:



 TextView text = (TextView)findViewById(R.id.text_l);
text.setHeight(70);


but nothing changed.










share|improve this question

























  • Try this: stackoverflow.com/questions/3522224/…

    – Nitesh Khosla
    Feb 7 '12 at 11:33
















33












33








33


7






I want to reset a textView height after I have added it to the main window in the xml file.



inside a RelativeLayout,



  <TextView
android:id="@+id/text_l"
android:layout_width="50sp"
android:layout_height="50sp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="10sp"
android:layout_marginTop="145dp"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000000" >
</TextView>


I just want to change it from 50 to 70:



I tried:



 TextView text = (TextView)findViewById(R.id.text_l);
text.setHeight(70);


but nothing changed.










share|improve this question
















I want to reset a textView height after I have added it to the main window in the xml file.



inside a RelativeLayout,



  <TextView
android:id="@+id/text_l"
android:layout_width="50sp"
android:layout_height="50sp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="10sp"
android:layout_marginTop="145dp"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000000" >
</TextView>


I just want to change it from 50 to 70:



I tried:



 TextView text = (TextView)findViewById(R.id.text_l);
text.setHeight(70);


but nothing changed.







android android-xml android-textview






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 7 '12 at 13:02









Seshu Vinay

10.1k751102




10.1k751102










asked Feb 7 '12 at 11:25









Q8yDevQ8yDev

170127




170127













  • Try this: stackoverflow.com/questions/3522224/…

    – Nitesh Khosla
    Feb 7 '12 at 11:33





















  • Try this: stackoverflow.com/questions/3522224/…

    – Nitesh Khosla
    Feb 7 '12 at 11:33



















Try this: stackoverflow.com/questions/3522224/…

– Nitesh Khosla
Feb 7 '12 at 11:33







Try this: stackoverflow.com/questions/3522224/…

– Nitesh Khosla
Feb 7 '12 at 11:33














4 Answers
4






active

oldest

votes


















89














You should change it via LayoutParams:



LayoutParams params = (LayoutParams) textView.getLayoutParams();
params.height = 70;
textView.setLayoutParams(params);


EDIT



You should not use sizes in pixels in you code, use dimensions for this:



dimens.xml:



<dimen name="text_view_height">50dp</dimen>


In code:



params.height = getResources().getDimensionPixelSize(R.dimen.text_view_height);





share|improve this answer





















  • 1





    Thanks man, that actually worked :D

    – Q8yDev
    Feb 7 '12 at 22:06











  • The bizare thing here is: textview.setheight(...) did work on some of my test devices, even though in contrast to the documentation of the setHeight function of TextView it does NOT change the layout parameters of the view. But on one of my test devices (Xperia ray, Android 4.0.4) this worked only in landscape but not in portrait mode. Changing the height in the layout params as you suggested worked fine on all of my test devices.

    – Nantoka
    Jun 17 '13 at 23:48











  • It didn't work for me. Im afraid it doesn't work in newer APIs. Once the TextView has been layered, setting height in the TextView has no effect.

    – cesards
    Mar 8 '17 at 12:01











  • Note that TextView textView = new TextView(context); textView.getLayoutParame() weill be null. You should judge null before use it.

    – BertKing
    Nov 16 '17 at 11:21





















10














Pragmatically you can set textview height like:



private TextView mTxtView;
int height = 50; //your textview height
mTxtView.getLayoutParams().height = height;





share|improve this answer





















  • 3





    I prefer to do this, rather than finding the correct Layoutparams class

    – Roisgoen
    Dec 15 '15 at 23:44











  • that's true @Roisgoen

    – Dhruv Raval
    Dec 16 '15 at 4:48











  • What calls for special attention is that if you use the textView to getLayoutParams(), it would be better to judge null?

    – BertKing
    Nov 16 '17 at 10:52



















4














you can dynamically set width and height of textview by



private TextView mTxtView;
private int screenWidth, screenHeight;
Display display = getWindowManager().getDefaultDisplay();
screenWidth = display.getWidth();
screenHeight = display.getHeight();


LayoutParams params = mTxtView.getLayoutParams();
params.width = screenWidth-30;
mTxtView.setLayoutParams(params);





share|improve this answer































    0














    I know this is an old question, but for the sake of others who might find this, there are scenarios where you should call textView.requestLayout() after changing the layout parameters. While it my be fine to omit it if you are simply changing the layout parameters as a one time thing before the layout is drawn. In my case, I wanted to change the height parameter of a TextView based on a radio button selection using onCheckedChangedListener, but the TextView height would only update the first time it was drawn. Adding requestLayout() solved this problem.



    TextView tv;
    ViewGroup.LayoutParams params = tv.getLayoutParams();
    params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
    if(!tv.isInLayout()) {//make sure it isn't currently in a layout pass
    tv.requestLayout();//request a layout pass
    }





    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f9175391%2fre-setting-a-textview-height-programmatically%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      89














      You should change it via LayoutParams:



      LayoutParams params = (LayoutParams) textView.getLayoutParams();
      params.height = 70;
      textView.setLayoutParams(params);


      EDIT



      You should not use sizes in pixels in you code, use dimensions for this:



      dimens.xml:



      <dimen name="text_view_height">50dp</dimen>


      In code:



      params.height = getResources().getDimensionPixelSize(R.dimen.text_view_height);





      share|improve this answer





















      • 1





        Thanks man, that actually worked :D

        – Q8yDev
        Feb 7 '12 at 22:06











      • The bizare thing here is: textview.setheight(...) did work on some of my test devices, even though in contrast to the documentation of the setHeight function of TextView it does NOT change the layout parameters of the view. But on one of my test devices (Xperia ray, Android 4.0.4) this worked only in landscape but not in portrait mode. Changing the height in the layout params as you suggested worked fine on all of my test devices.

        – Nantoka
        Jun 17 '13 at 23:48











      • It didn't work for me. Im afraid it doesn't work in newer APIs. Once the TextView has been layered, setting height in the TextView has no effect.

        – cesards
        Mar 8 '17 at 12:01











      • Note that TextView textView = new TextView(context); textView.getLayoutParame() weill be null. You should judge null before use it.

        – BertKing
        Nov 16 '17 at 11:21


















      89














      You should change it via LayoutParams:



      LayoutParams params = (LayoutParams) textView.getLayoutParams();
      params.height = 70;
      textView.setLayoutParams(params);


      EDIT



      You should not use sizes in pixels in you code, use dimensions for this:



      dimens.xml:



      <dimen name="text_view_height">50dp</dimen>


      In code:



      params.height = getResources().getDimensionPixelSize(R.dimen.text_view_height);





      share|improve this answer





















      • 1





        Thanks man, that actually worked :D

        – Q8yDev
        Feb 7 '12 at 22:06











      • The bizare thing here is: textview.setheight(...) did work on some of my test devices, even though in contrast to the documentation of the setHeight function of TextView it does NOT change the layout parameters of the view. But on one of my test devices (Xperia ray, Android 4.0.4) this worked only in landscape but not in portrait mode. Changing the height in the layout params as you suggested worked fine on all of my test devices.

        – Nantoka
        Jun 17 '13 at 23:48











      • It didn't work for me. Im afraid it doesn't work in newer APIs. Once the TextView has been layered, setting height in the TextView has no effect.

        – cesards
        Mar 8 '17 at 12:01











      • Note that TextView textView = new TextView(context); textView.getLayoutParame() weill be null. You should judge null before use it.

        – BertKing
        Nov 16 '17 at 11:21
















      89












      89








      89







      You should change it via LayoutParams:



      LayoutParams params = (LayoutParams) textView.getLayoutParams();
      params.height = 70;
      textView.setLayoutParams(params);


      EDIT



      You should not use sizes in pixels in you code, use dimensions for this:



      dimens.xml:



      <dimen name="text_view_height">50dp</dimen>


      In code:



      params.height = getResources().getDimensionPixelSize(R.dimen.text_view_height);





      share|improve this answer















      You should change it via LayoutParams:



      LayoutParams params = (LayoutParams) textView.getLayoutParams();
      params.height = 70;
      textView.setLayoutParams(params);


      EDIT



      You should not use sizes in pixels in you code, use dimensions for this:



      dimens.xml:



      <dimen name="text_view_height">50dp</dimen>


      In code:



      params.height = getResources().getDimensionPixelSize(R.dimen.text_view_height);






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Apr 18 '17 at 11:34









      SpyZip

      3,81241946




      3,81241946










      answered Feb 7 '12 at 11:28









      Jin35Jin35

      8,04622751




      8,04622751








      • 1





        Thanks man, that actually worked :D

        – Q8yDev
        Feb 7 '12 at 22:06











      • The bizare thing here is: textview.setheight(...) did work on some of my test devices, even though in contrast to the documentation of the setHeight function of TextView it does NOT change the layout parameters of the view. But on one of my test devices (Xperia ray, Android 4.0.4) this worked only in landscape but not in portrait mode. Changing the height in the layout params as you suggested worked fine on all of my test devices.

        – Nantoka
        Jun 17 '13 at 23:48











      • It didn't work for me. Im afraid it doesn't work in newer APIs. Once the TextView has been layered, setting height in the TextView has no effect.

        – cesards
        Mar 8 '17 at 12:01











      • Note that TextView textView = new TextView(context); textView.getLayoutParame() weill be null. You should judge null before use it.

        – BertKing
        Nov 16 '17 at 11:21
















      • 1





        Thanks man, that actually worked :D

        – Q8yDev
        Feb 7 '12 at 22:06











      • The bizare thing here is: textview.setheight(...) did work on some of my test devices, even though in contrast to the documentation of the setHeight function of TextView it does NOT change the layout parameters of the view. But on one of my test devices (Xperia ray, Android 4.0.4) this worked only in landscape but not in portrait mode. Changing the height in the layout params as you suggested worked fine on all of my test devices.

        – Nantoka
        Jun 17 '13 at 23:48











      • It didn't work for me. Im afraid it doesn't work in newer APIs. Once the TextView has been layered, setting height in the TextView has no effect.

        – cesards
        Mar 8 '17 at 12:01











      • Note that TextView textView = new TextView(context); textView.getLayoutParame() weill be null. You should judge null before use it.

        – BertKing
        Nov 16 '17 at 11:21










      1




      1





      Thanks man, that actually worked :D

      – Q8yDev
      Feb 7 '12 at 22:06





      Thanks man, that actually worked :D

      – Q8yDev
      Feb 7 '12 at 22:06













      The bizare thing here is: textview.setheight(...) did work on some of my test devices, even though in contrast to the documentation of the setHeight function of TextView it does NOT change the layout parameters of the view. But on one of my test devices (Xperia ray, Android 4.0.4) this worked only in landscape but not in portrait mode. Changing the height in the layout params as you suggested worked fine on all of my test devices.

      – Nantoka
      Jun 17 '13 at 23:48





      The bizare thing here is: textview.setheight(...) did work on some of my test devices, even though in contrast to the documentation of the setHeight function of TextView it does NOT change the layout parameters of the view. But on one of my test devices (Xperia ray, Android 4.0.4) this worked only in landscape but not in portrait mode. Changing the height in the layout params as you suggested worked fine on all of my test devices.

      – Nantoka
      Jun 17 '13 at 23:48













      It didn't work for me. Im afraid it doesn't work in newer APIs. Once the TextView has been layered, setting height in the TextView has no effect.

      – cesards
      Mar 8 '17 at 12:01





      It didn't work for me. Im afraid it doesn't work in newer APIs. Once the TextView has been layered, setting height in the TextView has no effect.

      – cesards
      Mar 8 '17 at 12:01













      Note that TextView textView = new TextView(context); textView.getLayoutParame() weill be null. You should judge null before use it.

      – BertKing
      Nov 16 '17 at 11:21







      Note that TextView textView = new TextView(context); textView.getLayoutParame() weill be null. You should judge null before use it.

      – BertKing
      Nov 16 '17 at 11:21















      10














      Pragmatically you can set textview height like:



      private TextView mTxtView;
      int height = 50; //your textview height
      mTxtView.getLayoutParams().height = height;





      share|improve this answer





















      • 3





        I prefer to do this, rather than finding the correct Layoutparams class

        – Roisgoen
        Dec 15 '15 at 23:44











      • that's true @Roisgoen

        – Dhruv Raval
        Dec 16 '15 at 4:48











      • What calls for special attention is that if you use the textView to getLayoutParams(), it would be better to judge null?

        – BertKing
        Nov 16 '17 at 10:52
















      10














      Pragmatically you can set textview height like:



      private TextView mTxtView;
      int height = 50; //your textview height
      mTxtView.getLayoutParams().height = height;





      share|improve this answer





















      • 3





        I prefer to do this, rather than finding the correct Layoutparams class

        – Roisgoen
        Dec 15 '15 at 23:44











      • that's true @Roisgoen

        – Dhruv Raval
        Dec 16 '15 at 4:48











      • What calls for special attention is that if you use the textView to getLayoutParams(), it would be better to judge null?

        – BertKing
        Nov 16 '17 at 10:52














      10












      10








      10







      Pragmatically you can set textview height like:



      private TextView mTxtView;
      int height = 50; //your textview height
      mTxtView.getLayoutParams().height = height;





      share|improve this answer















      Pragmatically you can set textview height like:



      private TextView mTxtView;
      int height = 50; //your textview height
      mTxtView.getLayoutParams().height = height;






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Sep 8 '15 at 6:36









      phi

      3,76312838




      3,76312838










      answered Aug 4 '15 at 10:38









      Dhruv RavalDhruv Raval

      3,8272329




      3,8272329








      • 3





        I prefer to do this, rather than finding the correct Layoutparams class

        – Roisgoen
        Dec 15 '15 at 23:44











      • that's true @Roisgoen

        – Dhruv Raval
        Dec 16 '15 at 4:48











      • What calls for special attention is that if you use the textView to getLayoutParams(), it would be better to judge null?

        – BertKing
        Nov 16 '17 at 10:52














      • 3





        I prefer to do this, rather than finding the correct Layoutparams class

        – Roisgoen
        Dec 15 '15 at 23:44











      • that's true @Roisgoen

        – Dhruv Raval
        Dec 16 '15 at 4:48











      • What calls for special attention is that if you use the textView to getLayoutParams(), it would be better to judge null?

        – BertKing
        Nov 16 '17 at 10:52








      3




      3





      I prefer to do this, rather than finding the correct Layoutparams class

      – Roisgoen
      Dec 15 '15 at 23:44





      I prefer to do this, rather than finding the correct Layoutparams class

      – Roisgoen
      Dec 15 '15 at 23:44













      that's true @Roisgoen

      – Dhruv Raval
      Dec 16 '15 at 4:48





      that's true @Roisgoen

      – Dhruv Raval
      Dec 16 '15 at 4:48













      What calls for special attention is that if you use the textView to getLayoutParams(), it would be better to judge null?

      – BertKing
      Nov 16 '17 at 10:52





      What calls for special attention is that if you use the textView to getLayoutParams(), it would be better to judge null?

      – BertKing
      Nov 16 '17 at 10:52











      4














      you can dynamically set width and height of textview by



      private TextView mTxtView;
      private int screenWidth, screenHeight;
      Display display = getWindowManager().getDefaultDisplay();
      screenWidth = display.getWidth();
      screenHeight = display.getHeight();


      LayoutParams params = mTxtView.getLayoutParams();
      params.width = screenWidth-30;
      mTxtView.setLayoutParams(params);





      share|improve this answer




























        4














        you can dynamically set width and height of textview by



        private TextView mTxtView;
        private int screenWidth, screenHeight;
        Display display = getWindowManager().getDefaultDisplay();
        screenWidth = display.getWidth();
        screenHeight = display.getHeight();


        LayoutParams params = mTxtView.getLayoutParams();
        params.width = screenWidth-30;
        mTxtView.setLayoutParams(params);





        share|improve this answer


























          4












          4








          4







          you can dynamically set width and height of textview by



          private TextView mTxtView;
          private int screenWidth, screenHeight;
          Display display = getWindowManager().getDefaultDisplay();
          screenWidth = display.getWidth();
          screenHeight = display.getHeight();


          LayoutParams params = mTxtView.getLayoutParams();
          params.width = screenWidth-30;
          mTxtView.setLayoutParams(params);





          share|improve this answer













          you can dynamically set width and height of textview by



          private TextView mTxtView;
          private int screenWidth, screenHeight;
          Display display = getWindowManager().getDefaultDisplay();
          screenWidth = display.getWidth();
          screenHeight = display.getHeight();


          LayoutParams params = mTxtView.getLayoutParams();
          params.width = screenWidth-30;
          mTxtView.setLayoutParams(params);






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 17 '13 at 10:55









          Rajeev KashyapRajeev Kashyap

          413




          413























              0














              I know this is an old question, but for the sake of others who might find this, there are scenarios where you should call textView.requestLayout() after changing the layout parameters. While it my be fine to omit it if you are simply changing the layout parameters as a one time thing before the layout is drawn. In my case, I wanted to change the height parameter of a TextView based on a radio button selection using onCheckedChangedListener, but the TextView height would only update the first time it was drawn. Adding requestLayout() solved this problem.



              TextView tv;
              ViewGroup.LayoutParams params = tv.getLayoutParams();
              params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
              if(!tv.isInLayout()) {//make sure it isn't currently in a layout pass
              tv.requestLayout();//request a layout pass
              }





              share|improve this answer




























                0














                I know this is an old question, but for the sake of others who might find this, there are scenarios where you should call textView.requestLayout() after changing the layout parameters. While it my be fine to omit it if you are simply changing the layout parameters as a one time thing before the layout is drawn. In my case, I wanted to change the height parameter of a TextView based on a radio button selection using onCheckedChangedListener, but the TextView height would only update the first time it was drawn. Adding requestLayout() solved this problem.



                TextView tv;
                ViewGroup.LayoutParams params = tv.getLayoutParams();
                params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
                if(!tv.isInLayout()) {//make sure it isn't currently in a layout pass
                tv.requestLayout();//request a layout pass
                }





                share|improve this answer


























                  0












                  0








                  0







                  I know this is an old question, but for the sake of others who might find this, there are scenarios where you should call textView.requestLayout() after changing the layout parameters. While it my be fine to omit it if you are simply changing the layout parameters as a one time thing before the layout is drawn. In my case, I wanted to change the height parameter of a TextView based on a radio button selection using onCheckedChangedListener, but the TextView height would only update the first time it was drawn. Adding requestLayout() solved this problem.



                  TextView tv;
                  ViewGroup.LayoutParams params = tv.getLayoutParams();
                  params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
                  if(!tv.isInLayout()) {//make sure it isn't currently in a layout pass
                  tv.requestLayout();//request a layout pass
                  }





                  share|improve this answer













                  I know this is an old question, but for the sake of others who might find this, there are scenarios where you should call textView.requestLayout() after changing the layout parameters. While it my be fine to omit it if you are simply changing the layout parameters as a one time thing before the layout is drawn. In my case, I wanted to change the height parameter of a TextView based on a radio button selection using onCheckedChangedListener, but the TextView height would only update the first time it was drawn. Adding requestLayout() solved this problem.



                  TextView tv;
                  ViewGroup.LayoutParams params = tv.getLayoutParams();
                  params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
                  if(!tv.isInLayout()) {//make sure it isn't currently in a layout pass
                  tv.requestLayout();//request a layout pass
                  }






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 1 at 5:18









                  smitty1smitty1

                  394518




                  394518






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f9175391%2fre-setting-a-textview-height-programmatically%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      MongoDB - Not Authorized To Execute Command

                      How to fix TextFormField cause rebuild widget in Flutter

                      in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith